Subject: Re: [PATCH net] netns: fix NLM_F_ECHO mechanism for RTM_NEWNSID

From: Guillaume Nault <[email-masked]>
Date: Wed, 9 Oct 2019 01:10:47 +0200

On Mon, Oct 07, 2019 at 01:58:35PM +0200, Nicolas Dichtel wrote:
> The flag NLM_F_ECHO aims to reply to the user the message notified to all
> listeners.
> It was not the case with the command RTM_NEWNSID, let's fix this.
> 
> Fixes: 0c7aecd4bde4 ("netns: add rtnl cmd to add and get peer netns ids")
> Reported-by: Guillaume Nault <[email-masked]>
> Signed-off-by: Nicolas Dichtel <[email-masked]>
> ---
>  net/core/net_namespace.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> index a0e0d298c991..f496ce0e8da8 100644
> --- a/net/core/net_namespace.c
> +++ b/net/core/net_namespace.c
> -static void rtnl_net_notifyid(struct net *net, int cmd, int id)
> +static void rtnl_net_notifyid(struct net *net, int cmd, int id, u32 portid,
> +			      struct nlmsghdr *nlh)
>  {
>  	struct net_fill_args fillargs = {
>  		.cmd = cmd,

We also need to set .portid and .seq otherwise rtnl_net_fill() builds
a netlink message with invalid port id and sequence number (as you
noted in your previous message).