[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wq8l5ppn.wl%atzm@stratosphere.co.jp>
Date: Tue, 30 Sep 2014 20:10:12 +0900
From: Atzm Watanabe <atzm@...atosphere.co.jp>
To: netdev@...r.kernel.org
Cc: Cong Wang <xiyou.wangcong@...il.com>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute2] iplink: do not require assigning negative ifindex at link creation
Since commit 3c682146aeff, iplink requires assigning negative
ifindex (-1) to the kernel when creating interface without
specifying index.
Cc: Cong Wang <xiyou.wangcong@...il.com>
Signed-off-by: Atzm Watanabe <atzm@...atosphere.co.jp>
---
ip/iplink.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ip/iplink.c b/ip/iplink.c
index cb9c870..de6b2a9 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -689,7 +689,10 @@ static int iplink_modify(int cmd, unsigned int flags, int argc, char **argv)
addattr_l(&req.n, sizeof(req), IFLA_LINK, &ifindex, 4);
}
- req.i.ifi_index = index;
+ if (index <= 0)
+ req.i.ifi_index = 0;
+ else
+ req.i.ifi_index = index;
}
if (name) {
--
1.8.1.5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists