diff options
| author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2015-01-15 09:11:16 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-01-19 14:21:26 -0500 |
| commit | d37512a277dfb2cef8a578e25a3246f61399a55a (patch) | |
| tree | 77d201937b891fe856ab910a5d5a86e7add51f52 /include | |
| parent | 0c7aecd4bde4b7302cd41986d3a29e4f0b0ed218 (diff) | |
rtnl: add link netns id to interface messages
This patch adds a new attribute (IFLA_LINK_NETNSID) which contains the 'link'
netns id when this netns is different from the netns where the interface
stands (for example for x-net interfaces like ip tunnels).
With this attribute, it's possible to interpret correctly all advertised
information (like IFLA_LINK, etc.).
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/rtnetlink.h | 2 | ||||
| -rw-r--r-- | include/uapi/linux/if_link.h | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index e21b9f9653c0..6c6d5393fc34 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
| @@ -46,6 +46,7 @@ static inline int rtnl_msg_family(const struct nlmsghdr *nlh) | |||
| 46 | * to create when creating a new device. | 46 | * to create when creating a new device. |
| 47 | * @get_num_rx_queues: Function to determine number of receive queues | 47 | * @get_num_rx_queues: Function to determine number of receive queues |
| 48 | * to create when creating a new device. | 48 | * to create when creating a new device. |
| 49 | * @get_link_net: Function to get the i/o netns of the device | ||
| 49 | */ | 50 | */ |
| 50 | struct rtnl_link_ops { | 51 | struct rtnl_link_ops { |
| 51 | struct list_head list; | 52 | struct list_head list; |
| @@ -93,6 +94,7 @@ struct rtnl_link_ops { | |||
| 93 | int (*fill_slave_info)(struct sk_buff *skb, | 94 | int (*fill_slave_info)(struct sk_buff *skb, |
| 94 | const struct net_device *dev, | 95 | const struct net_device *dev, |
| 95 | const struct net_device *slave_dev); | 96 | const struct net_device *slave_dev); |
| 97 | struct net *(*get_link_net)(const struct net_device *dev); | ||
| 96 | }; | 98 | }; |
| 97 | 99 | ||
| 98 | int __rtnl_link_register(struct rtnl_link_ops *ops); | 100 | int __rtnl_link_register(struct rtnl_link_ops *ops); |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index 2a8380edbb7e..0deee3eeddbf 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
| @@ -146,6 +146,7 @@ enum { | |||
| 146 | IFLA_PHYS_PORT_ID, | 146 | IFLA_PHYS_PORT_ID, |
| 147 | IFLA_CARRIER_CHANGES, | 147 | IFLA_CARRIER_CHANGES, |
| 148 | IFLA_PHYS_SWITCH_ID, | 148 | IFLA_PHYS_SWITCH_ID, |
| 149 | IFLA_LINK_NETNSID, | ||
| 149 | __IFLA_MAX | 150 | __IFLA_MAX |
| 150 | }; | 151 | }; |
| 151 | 152 | ||
