diff options
author | Cong Wang <xiyou.wangcong@gmail.com> | 2019-02-21 00:37:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-02-22 18:26:51 -0500 |
commit | 14215108a1fd7e002c0a1f9faf8fbaf41fdda50d (patch) | |
tree | c56c457e345a93a42c47d67d58961a534b3e663e /net/sched/cls_route.c | |
parent | 1a2566085650be593d464c4d73ac2d20ff67c058 (diff) |
net_sched: initialize net pointer inside tcf_exts_init()
For tcindex filter, it is too late to initialize the
net pointer in tcf_exts_validate(), as tcf_exts_get_net()
requires a non-NULL net pointer. We can just move its
initialization into tcf_exts_init(), which just requires
an additional parameter.
This makes the code in tcindex_alloc_perfect_hash()
prettier.
Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_route.c')
-rw-r--r-- | net/sched/cls_route.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index 444d15a75d98..f006af23b64a 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c | |||
@@ -497,7 +497,7 @@ static int route4_change(struct net *net, struct sk_buff *in_skb, | |||
497 | if (!f) | 497 | if (!f) |
498 | goto errout; | 498 | goto errout; |
499 | 499 | ||
500 | err = tcf_exts_init(&f->exts, TCA_ROUTE4_ACT, TCA_ROUTE4_POLICE); | 500 | err = tcf_exts_init(&f->exts, net, TCA_ROUTE4_ACT, TCA_ROUTE4_POLICE); |
501 | if (err < 0) | 501 | if (err < 0) |
502 | goto errout; | 502 | goto errout; |
503 | 503 | ||