public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel•org>
To: Yuyang Huang <yuyanghuang@google•com>
Cc: "David S. Miller" <davem@davemloft•net>,
	"Eric Dumazet" <edumazet@google•com>,
	"Jakub Kicinski" <kuba@kernel•org>,
	"Paolo Abeni" <pabeni@redhat•com>,
	"Simon Horman" <horms@kernel•org>,
	roopa@cumulusnetworks•com, jiri@resnulli•us,
	stephen@networkplumber•org, jimictw@google•com, prohr@google•com,
	liuhangbin@gmail•com, nicolas.dichtel@6wind•com, andrew@lunn•ch,
	netdev@vger•kernel.org, "Maciej Żenczykowski" <maze@google•com>,
	"Lorenzo Colitti" <lorenzo@google•com>
Subject: Re: [PATCH RESEND net-next] netlink: add IPv6 anycast join/leave notifications
Date: Mon, 6 Jan 2025 10:53:15 -0700	[thread overview]
Message-ID: <cf625a44-0db1-421d-acf9-e7ec60677697@kernel.org> (raw)
In-Reply-To: <20250105020016.699698-1-yuyanghuang@google.com>

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)
>   */


  reply	other threads:[~2025-01-06 17:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-05  2:00 [PATCH RESEND net-next] netlink: add IPv6 anycast join/leave notifications Yuyang Huang
2025-01-06 17:53 ` David Ahern [this message]
2025-01-07  1:31   ` Yuyang Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf625a44-0db1-421d-acf9-e7ec60677697@kernel.org \
    --to=dsahern@kernel$(echo .)org \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=horms@kernel$(echo .)org \
    --cc=jimictw@google$(echo .)com \
    --cc=jiri@resnulli$(echo .)us \
    --cc=kuba@kernel$(echo .)org \
    --cc=liuhangbin@gmail$(echo .)com \
    --cc=lorenzo@google$(echo .)com \
    --cc=maze@google$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nicolas.dichtel@6wind$(echo .)com \
    --cc=pabeni@redhat$(echo .)com \
    --cc=prohr@google$(echo .)com \
    --cc=roopa@cumulusnetworks$(echo .)com \
    --cc=stephen@networkplumber$(echo .)org \
    --cc=yuyanghuang@google$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox