[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cf625a44-0db1-421d-acf9-e7ec60677697@kernel.org>
Date: Mon, 6 Jan 2025 10:53:15 -0700
From: David Ahern <dsahern@...nel.org>
To: Yuyang Huang <yuyanghuang@...gle.com>
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
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