>From 698eb7aeb60baca7fc7f0fda9080174c96f92e02 Mon Sep 17 00:00:00 2001 From: Vivien Chappelier Date: Tue, 28 Oct 2008 18:06:13 +0100 Subject: [PATCH] Add support for testing IFLA_NET_NS --- include/linux/if_link.h | 2 ++ ip/iplink.c | 9 +++++++++ misc/Makefile | 2 +- 3 files changed, 12 insertions(+), 1 deletions(-) diff --git a/include/linux/if_link.h b/include/linux/if_link.h index c948395..fab393d 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h @@ -79,6 +79,8 @@ enum IFLA_LINKINFO, #define IFLA_LINKINFO IFLA_LINKINFO IFLA_NET_NS_PID, + IFLA_IFALIAS, + IFLA_NET_NS, __IFLA_MAX }; diff --git a/ip/iplink.c b/ip/iplink.c index fd23db1..ffb0d39 100644 --- a/ip/iplink.c +++ b/ip/iplink.c @@ -67,6 +67,7 @@ void iplink_usage(void) fprintf(stderr, " [ broadcast LLADDR ]\n"); fprintf(stderr, " [ mtu MTU ]\n"); fprintf(stderr, " [ netns PID ]\n"); + fprintf(stderr, " [ nsid NSID ]\n"); fprintf(stderr, " ip link show [ DEVICE ]\n"); if (iplink_have_newlink()) { @@ -179,6 +180,7 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, char abuf[32]; int qlen = -1; int mtu = -1; + int net = -1; int netns = -1; ret = argc; @@ -228,6 +230,13 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, if (get_integer(&netns, *argv, 0)) invarg("Invalid \"netns\" value\n", *argv); addattr_l(&req->n, sizeof(*req), IFLA_NET_NS_PID, &netns, 4); + } else if (strcmp(*argv, "nsid") == 0) { + NEXT_ARG(); + if (net != -1) + duparg("nsid", *argv); + if (get_integer(&net, *argv, 0)) + invarg("Invalid \"nsid\" value\n", *argv); + addattr_l(&req->n, sizeof(*req), IFLA_NET_NS, &net, 4); } else if (strcmp(*argv, "multicast") == 0) { NEXT_ARG(); req->i.ifi_change |= IFF_MULTICAST; diff --git a/misc/Makefile b/misc/Makefile index 8c25381..a4c9591 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -1,7 +1,7 @@ SSOBJ=ss.o ssfilter.o LNSTATOBJ=lnstat.o lnstat_util.o -TARGETS=ss nstat ifstat rtacct arpd lnstat +TARGETS=ss nstat ifstat rtacct lnstat include ../Config -- 1.5.4.4