summaryrefslogtreecommitdiff
path: root/include/uapi/linux/if_link.h
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2017-11-02 22:04:38 +0300
committerDavid S. Miller <davem@davemloft.net>2017-11-05 15:49:17 +0300
commit79e1ad148c844f5c8b9d76b36b26e3886dca95ae (patch)
tree5f627e30c0f3972db04c2e012474dc5486d8955b /include/uapi/linux/if_link.h
parent9354d452034273a50a4fd703bea31e5d6b1fc20b (diff)
downloadlinux-79e1ad148c844f5c8b9d76b36b26e3886dca95ae.tar.xz
rtnetlink: use netnsid to query interface
Currently, when an application gets netnsid from the kernel (for example as the result of RTM_GETLINK call on one end of the veth pair), it's not much useful. There's no reliable way to get to the netns fd from the netnsid, nor does any kernel API accept netnsid. Extend the RTM_GETLINK call to also accept netnsid. It will operate on the netns with the given netnsid in such case. Of course, the calling process needs to have enough capabilities in the target name space; for now, require CAP_NET_ADMIN. This can be relaxed in the future. To signal to the calling process that the kernel understood the new IFLA_IF_NETNSID attribute in the query, it will include it in the response. This is needed to detect older kernels, as they will just ignore IFLA_IF_NETNSID and query in the current name space. This patch implemetns IFLA_IF_NETNSID only for get and dump. For set operations, this can be extended later. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/if_link.h')
-rw-r--r--include/uapi/linux/if_link.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index b3cf5639ac8f..19fc02660e0c 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -160,6 +160,7 @@ enum {
IFLA_XDP,
IFLA_EVENT,
IFLA_NEW_NETNSID,
+ IFLA_IF_NETNSID,
__IFLA_MAX
};