lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADXeF1GgDTusBUrDv-7v6n9P-Wurhn19Z68KiEhxM5PMy_kpLQ@mail.gmail.com>
Date: Tue, 7 Jan 2025 10:31:18 +0900
From: Yuyang Huang <yuyanghuang@...gle.com>
To: David Ahern <dsahern@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, 
	roopa@...ulusnetworks.com, jiri@...nulli.us, stephen@...workplumber.org, 
	jimictw@...gle.com, prohr@...gle.com, liuhangbin@...il.com, 
	nicolas.dichtel@...nd.com, andrew@...n.ch, netdev@...r.kernel.org, 
	Maciej Żenczykowski <maze@...gle.com>, 
	Lorenzo Colitti <lorenzo@...gle.com>
Subject: Re: [PATCH RESEND net-next] netlink: add IPv6 anycast join/leave notifications

>0 initializations are not needed.

>simple error message should suffice; stack trace does not provide
>additional value.

Thanks for helping with the review. This patch is superseded by the v2
patch. I will adjust the comment in the v3 patch.

Thanks,
Yuyang

Thanks,
Yuyang


On Tue, Jan 7, 2025 at 2:53 AM David Ahern <dsahern@...nel.org> wrote:
>
> On 1/4/25 7:00 PM, Yuyang Huang wrote:
> > diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
> > index 562cace50ca9..6793ff436986 100644
> > --- a/net/ipv6/anycast.c
> > +++ b/net/ipv6/anycast.c
> > @@ -278,6 +278,40 @@ static struct ifacaddr6 *aca_alloc(struct fib6_info *f6i,
> >       return aca;
> >  }
> >
> > +static void inet6_ifacaddr_notify(struct net_device *dev,
> > +                               const struct ifacaddr6 *ifaca, int event)
> > +{
> > +     struct inet6_fill_args fillargs = {
> > +             .portid = 0,
> > +             .seq = 0,
> > +             .event = event,
> > +             .flags = 0,
>
> 0 initializations are not needed.
>
> > +             .netnsid = -1,
> > +     };
> > +     struct net *net = dev_net(dev);
> > +     struct sk_buff *skb;
> > +     int err = -ENOMEM;
> > +
> > +     skb = nlmsg_new(NLMSG_ALIGN(sizeof(struct ifaddrmsg)) +
> > +                     nla_total_size(sizeof(struct in6_addr)) +
> > +                     nla_total_size(sizeof(struct ifa_cacheinfo)),
> > +                     GFP_KERNEL);
> > +     if (!skb)
> > +             goto error;
> > +
> > +     err = inet6_fill_ifacaddr(skb, ifaca, &fillargs);
> > +     if (err < 0) {
> > +             WARN_ON_ONCE(err == -EMSGSIZE);
>
> simple error message should suffice; stack trace does not provide
> additional value.
>
> > +             nlmsg_free(skb);
> > +             goto error;
> > +     }
> > +
> > +     rtnl_notify(skb, net, 0, RTNLGRP_IPV6_ACADDR, NULL, GFP_KERNEL);
> > +     return;
> > +error:
> > +     rtnl_set_sk_err(net, RTNLGRP_IPV6_ACADDR, err);
> > +}
> > +
> >  /*
> >   *   device anycast group inc (add if not found)
> >   */
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ