Commit 832d1d5b authored by WANG Cong's avatar WANG Cong Committed by David S. Miller

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: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarJamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a56e1953
...@@ -204,7 +204,7 @@ struct tcf_proto_ops { ...@@ -204,7 +204,7 @@ struct tcf_proto_ops {
void (*walk)(struct tcf_proto*, struct tcf_walker *arg); void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
/* rtnetlink specific */ /* rtnetlink specific */
int (*dump)(struct tcf_proto*, unsigned long, int (*dump)(struct net*, struct tcf_proto*, unsigned long,
struct sk_buff *skb, struct tcmsg*); struct sk_buff *skb, struct tcmsg*);
struct module *owner; struct module *owner;
......
...@@ -340,7 +340,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n) ...@@ -340,7 +340,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n)
return err; return err;
} }
static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, static int tcf_fill_node(struct net *net, struct sk_buff *skb, struct tcf_proto *tp,
unsigned long fh, u32 portid, u32 seq, u16 flags, int event) unsigned long fh, u32 portid, u32 seq, u16 flags, int event)
{ {
struct tcmsg *tcm; struct tcmsg *tcm;
...@@ -362,7 +362,7 @@ static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, ...@@ -362,7 +362,7 @@ static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp,
tcm->tcm_handle = fh; tcm->tcm_handle = fh;
if (RTM_DELTFILTER != event) { if (RTM_DELTFILTER != event) {
tcm->tcm_handle = 0; tcm->tcm_handle = 0;
if (tp->ops->dump && tp->ops->dump(tp, fh, skb, tcm) < 0) if (tp->ops->dump && tp->ops->dump(net, tp, fh, skb, tcm) < 0)
goto nla_put_failure; goto nla_put_failure;
} }
nlh->nlmsg_len = skb_tail_pointer(skb) - b; nlh->nlmsg_len = skb_tail_pointer(skb) - b;
...@@ -385,7 +385,7 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb, ...@@ -385,7 +385,7 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb,
if (!skb) if (!skb)
return -ENOBUFS; return -ENOBUFS;
if (tcf_fill_node(skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) { if (tcf_fill_node(net, skb, tp, fh, portid, n->nlmsg_seq, 0, event) <= 0) {
kfree_skb(skb); kfree_skb(skb);
return -EINVAL; return -EINVAL;
} }
...@@ -404,8 +404,9 @@ static int tcf_node_dump(struct tcf_proto *tp, unsigned long n, ...@@ -404,8 +404,9 @@ static int tcf_node_dump(struct tcf_proto *tp, unsigned long n,
struct tcf_walker *arg) struct tcf_walker *arg)
{ {
struct tcf_dump_args *a = (void *)arg; struct tcf_dump_args *a = (void *)arg;
struct net *net = sock_net(a->skb->sk);
return tcf_fill_node(a->skb, tp, n, NETLINK_CB(a->cb->skb).portid, return tcf_fill_node(net, a->skb, tp, n, NETLINK_CB(a->cb->skb).portid,
a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER); a->cb->nlh->nlmsg_seq, NLM_F_MULTI, RTM_NEWTFILTER);
} }
...@@ -463,7 +464,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -463,7 +464,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
if (t > s_t) if (t > s_t)
memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0])); memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[0]));
if (cb->args[1] == 0) { if (cb->args[1] == 0) {
if (tcf_fill_node(skb, tp, 0, NETLINK_CB(cb->skb).portid, if (tcf_fill_node(net, skb, tp, 0, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh->nlmsg_seq, NLM_F_MULTI,
RTM_NEWTFILTER) <= 0) RTM_NEWTFILTER) <= 0)
break; break;
......
...@@ -241,7 +241,7 @@ static void basic_walk(struct tcf_proto *tp, struct tcf_walker *arg) ...@@ -241,7 +241,7 @@ static void basic_walk(struct tcf_proto *tp, struct tcf_walker *arg)
} }
} }
static int basic_dump(struct tcf_proto *tp, unsigned long fh, static int basic_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct sk_buff *skb, struct tcmsg *t) struct sk_buff *skb, struct tcmsg *t)
{ {
struct basic_filter *f = (struct basic_filter *) fh; struct basic_filter *f = (struct basic_filter *) fh;
......
...@@ -295,7 +295,7 @@ static int cls_bpf_change(struct net *net, struct sk_buff *in_skb, ...@@ -295,7 +295,7 @@ static int cls_bpf_change(struct net *net, struct sk_buff *in_skb,
return ret; return ret;
} }
static int cls_bpf_dump(struct tcf_proto *tp, unsigned long fh, static int cls_bpf_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct sk_buff *skb, struct tcmsg *tm) struct sk_buff *skb, struct tcmsg *tm)
{ {
struct cls_bpf_prog *prog = (struct cls_bpf_prog *) fh; struct cls_bpf_prog *prog = (struct cls_bpf_prog *) fh;
......
...@@ -164,7 +164,7 @@ static void cls_cgroup_walk(struct tcf_proto *tp, struct tcf_walker *arg) ...@@ -164,7 +164,7 @@ static void cls_cgroup_walk(struct tcf_proto *tp, struct tcf_walker *arg)
arg->count++; arg->count++;
} }
static int cls_cgroup_dump(struct tcf_proto *tp, unsigned long fh, static int cls_cgroup_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct sk_buff *skb, struct tcmsg *t) struct sk_buff *skb, struct tcmsg *t)
{ {
struct cls_cgroup_head *head = tp->root; struct cls_cgroup_head *head = tp->root;
......
...@@ -563,7 +563,7 @@ static void flow_put(struct tcf_proto *tp, unsigned long f) ...@@ -563,7 +563,7 @@ static void flow_put(struct tcf_proto *tp, unsigned long f)
{ {
} }
static int flow_dump(struct tcf_proto *tp, unsigned long fh, static int flow_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct sk_buff *skb, struct tcmsg *t) struct sk_buff *skb, struct tcmsg *t)
{ {
struct flow_filter *f = (struct flow_filter *)fh; struct flow_filter *f = (struct flow_filter *)fh;
......
...@@ -324,7 +324,7 @@ static void fw_walk(struct tcf_proto *tp, struct tcf_walker *arg) ...@@ -324,7 +324,7 @@ static void fw_walk(struct tcf_proto *tp, struct tcf_walker *arg)
} }
} }
static int fw_dump(struct tcf_proto *tp, unsigned long fh, static int fw_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct sk_buff *skb, struct tcmsg *t) struct sk_buff *skb, struct tcmsg *t)
{ {
struct fw_head *head = (struct fw_head *)tp->root; struct fw_head *head = (struct fw_head *)tp->root;
......
...@@ -551,7 +551,7 @@ static void route4_walk(struct tcf_proto *tp, struct tcf_walker *arg) ...@@ -551,7 +551,7 @@ static void route4_walk(struct tcf_proto *tp, struct tcf_walker *arg)
} }
} }
static int route4_dump(struct tcf_proto *tp, unsigned long fh, static int route4_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct sk_buff *skb, struct tcmsg *t) struct sk_buff *skb, struct tcmsg *t)
{ {
struct route4_filter *f = (struct route4_filter *)fh; struct route4_filter *f = (struct route4_filter *)fh;
......
...@@ -594,7 +594,7 @@ static void rsvp_walk(struct tcf_proto *tp, struct tcf_walker *arg) ...@@ -594,7 +594,7 @@ static void rsvp_walk(struct tcf_proto *tp, struct tcf_walker *arg)
} }
} }
static int rsvp_dump(struct tcf_proto *tp, unsigned long fh, static int rsvp_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct sk_buff *skb, struct tcmsg *t) struct sk_buff *skb, struct tcmsg *t)
{ {
struct rsvp_filter *f = (struct rsvp_filter *)fh; struct rsvp_filter *f = (struct rsvp_filter *)fh;
......
...@@ -422,7 +422,7 @@ static void tcindex_destroy(struct tcf_proto *tp) ...@@ -422,7 +422,7 @@ static void tcindex_destroy(struct tcf_proto *tp)
} }
static int tcindex_dump(struct tcf_proto *tp, unsigned long fh, static int tcindex_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct sk_buff *skb, struct tcmsg *t) struct sk_buff *skb, struct tcmsg *t)
{ {
struct tcindex_data *p = PRIV(tp); struct tcindex_data *p = PRIV(tp);
......
...@@ -712,7 +712,7 @@ static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg) ...@@ -712,7 +712,7 @@ static void u32_walk(struct tcf_proto *tp, struct tcf_walker *arg)
} }
} }
static int u32_dump(struct tcf_proto *tp, unsigned long fh, static int u32_dump(struct net *net, struct tcf_proto *tp, unsigned long fh,
struct sk_buff *skb, struct tcmsg *t) struct sk_buff *skb, struct tcmsg *t)
{ {
struct tc_u_knode *n = (struct tc_u_knode *)fh; struct tc_u_knode *n = (struct tc_u_knode *)fh;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment