]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/core/fib_rules.c
[NET]: Make the device list and device lookups per namespace.
[linux-2.6-omap-h63xx.git] / net / core / fib_rules.c
index 9eabe1ae01dc3ca147487558ce322ef4dc028129..1ba71baf87ef1a96754cd26e02f978d8e3378cb1 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/list.h>
 #include <net/net_namespace.h>
+#include <net/sock.h>
 #include <net/fib_rules.h>
 
 static LIST_HEAD(rules_ops);
@@ -198,6 +199,7 @@ errout:
 
 static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
 {
+       struct net *net = skb->sk->sk_net;
        struct fib_rule_hdr *frh = nlmsg_data(nlh);
        struct fib_rules_ops *ops = NULL;
        struct fib_rule *rule, *r, *last = NULL;
@@ -235,7 +237,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
 
                rule->ifindex = -1;
                nla_strlcpy(rule->ifname, tb[FRA_IFNAME], IFNAMSIZ);
-               dev = __dev_get_by_name(rule->ifname);
+               dev = __dev_get_by_name(net, rule->ifname);
                if (dev)
                        rule->ifindex = dev->ifindex;
        }