Le 22/11/2018 à 17:40, David Ahern a écrit : > On 11/22/18 8:50 AM, Nicolas Dichtel wrote: >> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c >> index dd25fb22ad45..25030e0317a2 100644 >> --- a/net/core/net_namespace.c >> +++ b/net/core/net_namespace.c >> @@ -745,6 +745,8 @@ struct net_fill_args { >> int flags; >> int cmd; >> int nsid; >> + bool add_ref; >> + int ref_nsid; >> }; >> >> static int rtnl_net_fill(struct sk_buff *skb, struct net_fill_args *args) >> @@ -763,6 +765,10 @@ static int rtnl_net_fill(struct sk_buff *skb, struct >> net_fill_args *args) >> if (nla_put_s32(skb, NETNSA_NSID, args->nsid)) >> goto nla_put_failure; >> >> + if (args->add_ref && >> + nla_put_s32(skb, NETNSA_CURRENT_NSID, args->ref_nsid)) >> + goto nla_put_failure; >> + > > you need to add NETNSA_CURRENT_NSID to rtnl_net_get_size. > Good catch. I thought to this and I forgot at the end :/
- Re: [PATCH net-next 2/4] netns: add suppo... Nicolas Dichtel
- [PATCH net-next 3/4] netns: enable to specify a nsid for a... Nicolas Dichtel
- [PATCH net-next 4/4] netns: enable to dump full nsid trans... Nicolas Dichtel
- Re: [PATCH net-next 4/4] netns: enable to dump full n... David Ahern
- Re: [PATCH net-next 4/4] netns: enable to dump fu... Nicolas Dichtel
- Re: [PATCH net-next 4/4] netns: enable to dum... David Ahern
- [PATCH net-next 1/4] netns: remove net arg from rtnl_net_f... Nicolas Dichtel
- [PATCH net-next v2 0/5] Ease to interpret net-nsid Nicolas Dichtel
- [PATCH net-next v2 5/5] netns: enable to dump full ns... Nicolas Dichtel
- Re: [PATCH net-next v2 5/5] netns: enable to dump... David Ahern
- Re: [PATCH net-next v2 5/5] netns: enable to ... Nicolas Dichtel
- [PATCH net-next v2 3/5] netns: add support of NETNSA_... Nicolas Dichtel
- [PATCH net-next v2 1/5] netns: remove net arg from rt... Nicolas Dichtel
- [PATCH net-next v2 2/5] netns: introduce 'struct net_... Nicolas Dichtel
- [PATCH net-next v2 4/5] netns: enable to specify a ns... Nicolas Dichtel
- [PATCH net-next v3 0/5] Ease to interpret net-nsid Nicolas Dichtel
- [PATCH net-next v3 3/5] netns: add support of NET... Nicolas Dichtel