From f53c2952c63146ff1b7124cb92b342ca00323028 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Wed, 8 Aug 2012 21:53:19 +0000 Subject: [PATCH] --- yaml --- r: 327397 b: refs/heads/master c: aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 h: refs/heads/master i: 327395: 99aa9856bbd55c1ae96dbd33593d07b128f9c8be v: v3 --- [refs] | 2 +- trunk/include/net/net_namespace.h | 1 + trunk/net/core/dev.c | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index edad6984434f..a4d1fdaed046 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e6f8f1a739b652c56e6f959d6714d92e05621e21 +refs/heads/master: aa79e66eee5d525e2fcbd2a5fcb87ae3dd4aa9e9 diff --git a/trunk/include/net/net_namespace.h b/trunk/include/net/net_namespace.h index ae1cd6c9ba52..6dc3db3466bf 100644 --- a/trunk/include/net/net_namespace.h +++ b/trunk/include/net/net_namespace.h @@ -66,6 +66,7 @@ struct net { struct hlist_head *dev_name_head; struct hlist_head *dev_index_head; unsigned int dev_base_seq; /* protected by rtnl_mutex */ + int ifindex; /* core fib_rules */ struct list_head rules_ops; diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index 3ca300d85271..1f06df8d10a3 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -5221,12 +5221,12 @@ int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg) */ static int dev_new_index(struct net *net) { - static int ifindex; + int ifindex = net->ifindex; for (;;) { if (++ifindex <= 0) ifindex = 1; if (!__dev_get_by_index(net, ifindex)) - return ifindex; + return net->ifindex = ifindex; } }