summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/if_link.h
diff options
context:
space:
mode:
authorJiri Benc2017-11-02 20:04:38 +0100
committerDavid S. Miller2017-11-05 13:49:17 +0100
commit79e1ad148c844f5c8b9d76b36b26e3886dca95ae (patch)
tree5f627e30c0f3972db04c2e012474dc5486d8955b /include/uapi/linux/if_link.h
parentopenvswitch: reliable interface indentification in port dumps (diff)
downloadkernel-qcow2-linux-79e1ad148c844f5c8b9d76b36b26e3886dca95ae.tar.gz
kernel-qcow2-linux-79e1ad148c844f5c8b9d76b36b26e3886dca95ae.tar.xz
kernel-qcow2-linux-79e1ad148c844f5c8b9d76b36b26e3886dca95ae.zip
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
};