]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net_sched: add struct net pointer to tcf_proto_ops->dump
authorWANG Cong <xiyou.wangcong@gmail.com>
Fri, 10 Jan 2014 00:14:01 +0000 (16:14 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Jan 2014 19:50:14 +0000 (11:50 -0800)
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>
include/net/sch_generic.h
net/sched/cls_api.c
net/sched/cls_basic.c
net/sched/cls_bpf.c
net/sched/cls_cgroup.c
net/sched/cls_flow.c
net/sched/cls_fw.c
net/sched/cls_route.c
net/sched/cls_rsvp.h
net/sched/cls_tcindex.c
net/sched/cls_u32.c

index 013d96dc69183c906adeeca604ecf8a7cea80082..d062f81c692f1ee3e61ba1a06bd27e3a9edb761a 100644 (file)
@@ -204,7 +204,7 @@ struct tcf_proto_ops {
        void                    (*walk)(struct tcf_proto*, struct tcf_walker *arg);
 
        /* 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 module           *owner;
index d8c42b1b88e5d3f8ca06f929f2b4ec6287c609e0..29a30a14c31596cc51028be8db46eb4df9756f6e 100644 (file)
@@ -340,7 +340,7 @@ errout:
        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)
 {
        struct tcmsg *tcm;
@@ -362,7 +362,7 @@ static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp,
        tcm->tcm_handle = fh;
        if (RTM_DELTFILTER != event) {
                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;
        }
        nlh->nlmsg_len = skb_tail_pointer(skb) - b;
@@ -385,7 +385,7 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb,
        if (!skb)
                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);
                return -EINVAL;
        }
@@ -404,8 +404,9 @@ static int tcf_node_dump(struct tcf_proto *tp, unsigned long n,
                         struct tcf_walker *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);
 }
 
@@ -463,7 +464,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
                if (t > s_t)
                        memset(&cb->args[1], 0, sizeof(cb->args)-sizeof(cb->args[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,
                                          RTM_NEWTFILTER) <= 0)
                                break;
index b6552035d1f4947ca88754b727d8930b6ead35de..af6bea1a6a54dc3c5b2a3ae6721d1b7e96396a70 100644 (file)
@@ -241,7 +241,7 @@ skip:
        }
 }
 
-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 basic_filter *f = (struct basic_filter *) fh;
index 00a5a585e5f1b6a26572bc21cd5b05221470ac49..8e3cf49118e3a2297214de12313bb499cbfe9054 100644 (file)
@@ -295,7 +295,7 @@ errout:
        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 cls_bpf_prog *prog = (struct cls_bpf_prog *) fh;
index 8349fcdc50f36125f7536639bc1eb48eaed39428..8e2158ab551c0c9d7258ffae3e474788bfc64565 100644 (file)
@@ -164,7 +164,7 @@ skip:
        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 cls_cgroup_head *head = tp->root;
index dfd18a5c3e817037a50f3a5de92e3ac04e34095b..257029c5433298f62101533ada3a81c246eb0d7a 100644 (file)
@@ -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 flow_filter *f = (struct flow_filter *)fh;
index 3f9cece13807992ca2faf56252beb14d0d42bdbf..d605285af5bfe899819a58808da2b6a1f78179bc 100644 (file)
@@ -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 fw_head *head = (struct fw_head *)tp->root;
index 2473953a5948b3877f7a215373fe558b8a63112c..c9136136727b73c7a6e118f91d6b3b085ba0119f 100644 (file)
@@ -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 route4_filter *f = (struct route4_filter *)fh;
index 4f25c2ac825b706b8275106f904180295fcce7ed..19f8e5dfa8bdaebcd9ab903050047e7e49690530 100644 (file)
@@ -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 rsvp_filter *f = (struct rsvp_filter *)fh;
index ffad18791c930dd8e2f34624ce0ce35d82a95bc0..f57535354243bfed5c62e48aab9be27aab6c6c36 100644 (file)
@@ -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 tcindex_data *p = PRIV(tp);
index 20f2fb79c74746ea0ce2d31b2b65290d2064420b..e25411a80f9b317eb6029f768587b5e55f9d1609 100644 (file)
@@ -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 tc_u_knode *n = (struct tc_u_knode *)fh;