Re: [PATCH net 1/1 v4] rtnetlink: require unique netns identifier

2018-02-08 Thread Christian Brauner
On Thu, Feb 8, 2018 at 8:33 PM, David Miller wrote: > From: Christian Brauner > Date: Wed, 7 Feb 2018 13:53:20 +0100 > >> Since we've added support for IFLA_IF_NETNSID for RTM_{DEL,GET,SET,NEW}LINK >> it is possible for userspace to send us requests with three different >> properties to identify

Re: [PATCH net 1/1 v4] rtnetlink: require unique netns identifier

2018-02-08 Thread David Miller
From: Christian Brauner Date: Wed, 7 Feb 2018 13:53:20 +0100 > Since we've added support for IFLA_IF_NETNSID for RTM_{DEL,GET,SET,NEW}LINK > it is possible for userspace to send us requests with three different > properties to identify a target network namespace. This affects at least > RTM_{NEW

Re: [PATCH net 1/1 v4] rtnetlink: require unique netns identifier

2018-02-07 Thread Jiri Benc
On Wed, 7 Feb 2018 14:36:21 +0100, Christian Brauner wrote: > On Wed, Feb 07, 2018 at 04:20:01PM +0300, Kirill Tkhai wrote: > > Can't we write these 3 above branches more compact? Something like this: > > > > if (!!tb[IFLA_NET_NS_FD] + !!tb[IFLA_IF_NETNSID] + > > !!tb[IFLA_NET_NS_PID] <= 1) >

Re: [PATCH net 1/1 v4] rtnetlink: require unique netns identifier

2018-02-07 Thread Christian Brauner
On Wed, Feb 07, 2018 at 04:20:01PM +0300, Kirill Tkhai wrote: > > > On 07.02.2018 15:53, Christian Brauner wrote: > > Since we've added support for IFLA_IF_NETNSID for RTM_{DEL,GET,SET,NEW}LINK > > it is possible for userspace to send us requests with three different > > properties to identify a

Re: [PATCH net 1/1 v4] rtnetlink: require unique netns identifier

2018-02-07 Thread Kirill Tkhai
On 07.02.2018 15:53, Christian Brauner wrote: > Since we've added support for IFLA_IF_NETNSID for RTM_{DEL,GET,SET,NEW}LINK > it is possible for userspace to send us requests with three different > properties to identify a target network namespace. This affects at least > RTM_{NEW,SET}LINK. Each

[PATCH net 1/1 v4] rtnetlink: require unique netns identifier

2018-02-07 Thread Christian Brauner
Since we've added support for IFLA_IF_NETNSID for RTM_{DEL,GET,SET,NEW}LINK it is possible for userspace to send us requests with three different properties to identify a target network namespace. This affects at least RTM_{NEW,SET}LINK. Each of them could potentially refer to a different network n