Le 21/11/2018 à 19:09, David Ahern a écrit : > On 11/21/18 4:01 AM, Nicolas Dichtel wrote: >> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c >> index 92730905886c..fc568cd0b560 100644 >> --- a/net/core/net_namespace.c >> +++ b/net/core/net_namespace.c >> @@ -740,7 +740,7 @@ static int rtnl_net_get_size(void) >> } >> >> static int rtnl_net_fill(struct sk_buff *skb, u32 portid, u32 seq, int >> flags, >> - int cmd, int nsid) >> + int cmd, int nsid, bool add_ref, int ref_nsid) >> { >> struct nlmsghdr *nlh; >> struct rtgenmsg *rth; >> @@ -755,6 +755,9 @@ static int rtnl_net_fill(struct sk_buff *skb, u32 >> portid, u32 seq, int flags, >> if (nla_put_s32(skb, NETNSA_NSID, nsid)) >> goto nla_put_failure; >> >> + if (add_ref && nla_put_s32(skb, NETNSA_CURRENT_NSID, ref_nsid)) >> + goto nla_put_failure; > > Why not use ref_nsid >= 0 and drop the add_ref argument? Because ref_nsid can be -1 (NETNSA_NSID_NOT_ASSIGNED) and I didn't want to add another magic, I think it's clearer with an explicit bool.
- [PATCH net-next 0/4] Ease to interpret net-nsid Nicolas Dichtel
- [PATCH net-next 2/4] netns: add support of NETNSA_TAR... Nicolas Dichtel
- Re: [PATCH net-next 2/4] netns: add support of NE... David Ahern
- Re: [PATCH net-next 2/4] netns: add support o... Nicolas Dichtel
- Re: [PATCH net-next 2/4] netns: add suppo... David Ahern
- Re: [PATCH net-next 2/4] netns: add ... Nicolas Dichtel
- [PATCH net-next 3/4] netns: enable to specify a nsid ... Nicolas Dichtel
- [PATCH net-next 4/4] netns: enable to dump full nsid ... Nicolas Dichtel
- Re: [PATCH net-next 4/4] netns: enable to dump fu... David Ahern
- Re: [PATCH net-next 4/4] netns: enable to dum... Nicolas Dichtel
- Re: [PATCH net-next 4/4] netns: enable to... David Ahern
- [PATCH net-next 1/4] netns: remove net arg from rtnl_... 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 ful... Nicolas Dichtel
- Re: [PATCH net-next v2 5/5] netns: enable to ... David Ahern
- Re: [PATCH net-next v2 5/5] netns: enable... Nicolas Dichtel
- [PATCH net-next v2 3/5] netns: add support of NET... Nicolas Dichtel
- Re: [PATCH net-next v2 3/5] netns: add suppor... David Ahern
- [PATCH net-next v2 1/5] netns: remove net arg fro... Nicolas Dichtel
- Re: [PATCH net-next v2 1/5] netns: remove net... David Ahern