diff options
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r-- | net/sched/cls_api.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 7cf6c0fbc7a6..f082b27ff46d 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/kmod.h> | 24 | #include <linux/kmod.h> |
25 | #include <linux/netlink.h> | 25 | #include <linux/netlink.h> |
26 | #include <linux/err.h> | 26 | #include <linux/err.h> |
27 | #include <linux/slab.h> | ||
27 | #include <net/net_namespace.h> | 28 | #include <net/net_namespace.h> |
28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
29 | #include <net/netlink.h> | 30 | #include <net/netlink.h> |
@@ -137,7 +138,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg) | |||
137 | int err; | 138 | int err; |
138 | int tp_created = 0; | 139 | int tp_created = 0; |
139 | 140 | ||
140 | if (net != &init_net) | 141 | if (!net_eq(net, &init_net)) |
141 | return -EINVAL; | 142 | return -EINVAL; |
142 | 143 | ||
143 | replay: | 144 | replay: |
@@ -404,6 +405,7 @@ static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, | |||
404 | a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER); | 405 | a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER); |
405 | } | 406 | } |
406 | 407 | ||
408 | /* called with RTNL */ | ||
407 | static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) | 409 | static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) |
408 | { | 410 | { |
409 | struct net *net = sock_net(skb->sk); | 411 | struct net *net = sock_net(skb->sk); |
@@ -417,12 +419,12 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) | |||
417 | const struct Qdisc_class_ops *cops; | 419 | const struct Qdisc_class_ops *cops; |
418 | struct tcf_dump_args arg; | 420 | struct tcf_dump_args arg; |
419 | 421 | ||
420 | if (net != &init_net) | 422 | if (!net_eq(net, &init_net)) |
421 | return 0; | 423 | return 0; |
422 | 424 | ||
423 | if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm))) | 425 | if (cb->nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*tcm))) |
424 | return skb->len; | 426 | return skb->len; |
425 | if ((dev = dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) | 427 | if ((dev = __dev_get_by_index(&init_net, tcm->tcm_ifindex)) == NULL) |
426 | return skb->len; | 428 | return skb->len; |
427 | 429 | ||
428 | if (!tcm->tcm_parent) | 430 | if (!tcm->tcm_parent) |
@@ -484,7 +486,6 @@ errout: | |||
484 | if (cl) | 486 | if (cl) |
485 | cops->put(q, cl); | 487 | cops->put(q, cl); |
486 | out: | 488 | out: |
487 | dev_put(dev); | ||
488 | return skb->len; | 489 | return skb->len; |
489 | } | 490 | } |
490 | 491 | ||