summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-09-25 09:19:05 +0200
committerGitHub <noreply@github.com>2023-09-25 09:19:05 +0200
commit9f9959cb23bbec0c57e12029c2b6d10dd53b28dc (patch)
treeba64bd1b23cfaa7e7003fac36a91f3ffa936c08d
parent12277333d0895231db94eb58604391d7a754b2d6 (diff)
parentd1504255c69d983c9b5a184865291a726abd8751 (diff)
Merge pull request #171 from pktpls/rtnl-netnsid
rtnl: add IFLA_IF_NETNSID for operating in other namespaces
-rw-r--r--lib/rtnl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/rtnl.c b/lib/rtnl.c
index e5efa25..b6add37 100644
--- a/lib/rtnl.c
+++ b/lib/rtnl.c
@@ -713,7 +713,7 @@ static const uc_nl_nested_spec_t link_attrs_stats64_rta = {
static const uc_nl_nested_spec_t link_msg = {
.headsize = NLA_ALIGN(sizeof(struct ifinfomsg)),
- .nattrs = 25,
+ .nattrs = 26,
.attrs = {
{ IFLA_UNSPEC, "family", DT_U8, 0, MEMBER(ifinfomsg, ifi_family) },
{ IFLA_UNSPEC, "type", DT_U16, 0, MEMBER(ifinfomsg, ifi_type) },
@@ -724,9 +724,7 @@ static const uc_nl_nested_spec_t link_msg = {
{ IFLA_BROADCAST, "broadcast", DT_LLADDR, 0, NULL },
{ IFLA_TXQLEN, "txqlen", DT_U32, 0, NULL },
{ IFLA_MTU, "mtu", DT_U32, 0, NULL },
- /* { IFLA_NETNS_PID, "netns", DT_U32, 0, NULL }, */
{ IFLA_CARRIER, "carrier", DT_BOOL, 0, NULL },
- /* IFLA_VFINFO_LIST */
{ IFLA_MASTER, "master", DT_NETDEV, DF_ALLOW_NONE, NULL },
{ IFLA_IFALIAS, "ifalias", DT_STRING, 0, NULL },
{ IFLA_LINKMODE, "linkmode", DT_U8, 0, NULL },
@@ -735,6 +733,7 @@ static const uc_nl_nested_spec_t link_msg = {
{ IFLA_NUM_RX_QUEUES, "num_rx_queues", DT_U32, 0, NULL },
{ IFLA_AF_SPEC, "af_spec", DT_AFSPEC, 0, NULL },
{ IFLA_LINK_NETNSID, "link_netnsid", DT_U32, 0, NULL },
+ { IFLA_TARGET_NETNSID, "target_netnsid", DT_S32, 0, NULL },
{ IFLA_PROTO_DOWN, "proto_down", DT_BOOL, 0, NULL },
{ IFLA_GROUP, "group", DT_U32, 0, NULL },
{ IFLA_LINK, "link", DT_NETDEV, 0, NULL },
@@ -742,6 +741,10 @@ static const uc_nl_nested_spec_t link_msg = {
{ IFLA_LINKINFO, "linkinfo", DT_LINKINFO, 0, NULL }, /* XXX: DF_NO_GET ? */
{ IFLA_EXT_MASK, "ext_mask", DT_U32, 0, NULL },
{ IFLA_STATS64, "stats64", DT_NESTED, DF_NO_SET, &link_attrs_stats64_rta },
+ /* TODO: IFLA_VFINFO_LIST */
+ /* TODO: the following two should be straightforward, just uncomment and test */
+ /* { IFLA_NET_NS_PID, "net_ns_pid", DT_S32, 0, NULL }, */
+ /* { IFLA_NET_NS_FD, "net_ns_fd", DT_S32, 0, NULL }, */
}
};