Re: [PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-22 Thread Nicolas Dichtel
Le 21/11/2018 à 22:07, David Ahern a écrit : > On 11/21/18 1:58 PM, Nicolas Dichtel wrote: >> The target-nsid is not stored in net_cb (not needed). ref_net is set only if >> tgt_net comes from TARGET_NSID. I can add a comment. > > ref_net is added by this patch and it is only used (unless I

Re: [PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-21 Thread David Ahern
On 11/21/18 1:58 PM, Nicolas Dichtel wrote: > The target-nsid is not stored in net_cb (not needed). ref_net is set only if > tgt_net comes from TARGET_NSID. I can add a comment. ref_net is added by this patch and it is only used (unless I missed something) to know if the put_net is needed. ie/,

Re: [PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-21 Thread Nicolas Dichtel
Le 21/11/2018 à 19:05, David Ahern a écrit : > On 11/21/18 4:01 AM, Nicolas Dichtel wrote: >> static int rtnl_net_dumpid(struct sk_buff *skb, struct netlink_callback *cb) >> { >> -struct net *net = sock_net(skb->sk); >> struct rtnl_net_dump_cb net_cb = { >> -.net = net, >> +

Re: [PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-21 Thread David Ahern
On 11/21/18 4:01 AM, Nicolas Dichtel wrote: > static int rtnl_net_dumpid(struct sk_buff *skb, struct netlink_callback *cb) > { > - struct net *net = sock_net(skb->sk); > struct rtnl_net_dump_cb net_cb = { > - .net = net, > + .tgt_net = sock_net(skb->sk), >

[PATCH net-next 2/4] netns: add support of NETNSA_TARGET_NSID

2018-11-21 Thread Nicolas Dichtel
Like it was done for link and address, add the ability to perform get/dump in another netns by specifying a target nsid attribute. Signed-off-by: Nicolas Dichtel --- include/uapi/linux/net_namespace.h | 1 + net/core/net_namespace.c | 97 -- 2 files