diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2014-01-09 19:14:01 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-13 14:50:14 -0500 |
commit | 832d1d5bfaefafa5aa40282f6765c6d996fe384e (patch) | |
tree | 2dd7b013f0a2b621a4346dad8d22c8374cd10eb2 /net/sched/cls_api.c | |
parent | a56e19538d02ade9ee6ae82da4a216d7a632e8d5 (diff) |
net_sched: add struct net pointer to tcf_proto_ops->dump
It will be needed by the next patch.
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r-- | net/sched/cls_api.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index d8c42b1b88e5..29a30a14c315 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -340,7 +340,7 @@ errout: | |||
340 | return err; | 340 | return err; |
341 | } | 341 | } |
342 | 342 | ||
343 | static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, | 343 | static int tcf_fill_node(struct net *net, struct sk_buff *skb, struct tcf_proto *tp, |
344 | unsigned long fh, u32 portid, u32 seq, u16 flags, int event) | 344 | unsigned long fh, u32 portid, u32 seq, u16 flags, int event) |
345 | { | 345 | { |
346 | struct tcmsg *tcm; | 346 | struct tcmsg *tcm; |
@@ -362,7 +362,7 @@ static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, | |||
362 | tcm->tcm_handle = fh; | 362 | tcm->tcm_handle = fh; |
363 | if (RTM_DELTFILTER != event) { | 363 | if (RTM_DELTFILTER != event) { |
364 | tcm->tcm_handle = 0; | 364 | tcm->tcm_handle = 0; |
365 | if (tp->ops->dump && tp->ops->dump(tp, fh, skb, tcm) < 0) | 365 | if (tp->ops->dump && tp->ops->dump(net, tp, fh, skb, tcm) < 0) |
366 | goto nla_put_failure; | 366 | goto nla_put_failure; |
367 | } | 367 | } |
368 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 368 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; |
@@ -385,7 +385,7 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb, | |||
385 | if (!skb) | 385 | if (!skb) |
386 | return -ENOBUFS; | 386 | return -ENOBUFS; |
387 | 387 | ||
388 | if (tcf_fill_node(skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) { | 388 | if (tcf_fill_node(net, skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) { |
389 | kfree_skb(skb); | 389 | kfree_skb(skb); |
390 | return -EINVAL; | 390 | return -EINVAL; |
391 | } | 391 | } |
@@ -404,8 +404,9 @@ static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, | |||
404 | struct tcf_walker *arg) | 404 | struct tcf_walker *arg) |
405 | { | 405 | { |
406 | struct tcf_dump_args *a = (void *)arg; | 406 | struct tcf_dump_args *a = (void *)arg; |
407 | struct net *net = sock_net(a->skb->sk); | ||
407 | 408 | ||
408 | return tcf_fill_node(a->skb, tp, n, NETLINK_CB(a->cb->skb).portid, | 409 | return tcf_fill_node(net, a->skb, tp, n, NETLINK_CB(a->cb->skb).portid, |
409 | a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER); | 410 | a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER); |
410 | } | 411 | } |
411 | 412 | ||
@@ -463,7 +464,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) | |||
463 | if (t > s_t) | 464 | if (t > s_t) |
464 | memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0])); | 465 | memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0])); |
465 | if (cb->args[1] == 0) { | 466 | if (cb->args[1] == 0) { |
466 | if (tcf_fill_node(skb, tp, 0, NETLINK_CB(cb->skb).portid, | 467 | if (tcf_fill_node(net, skb, tp, 0, NETLINK_CB(cb->skb).portid, |
467 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 468 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |
468 | RTM_NEWTFILTER) <= 0) | 469 | RTM_NEWTFILTER) <= 0) |
469 | break; | 470 | break; |