diff options
Diffstat (limited to 'net/sched/act_mirred.c')
-rw-r--r-- | net/sched/act_mirred.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 6cb5e30dcf8c..1aff005d95cd 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
@@ -54,6 +54,10 @@ static inline int tcf_mirred_release(struct tcf_mirred *m, int bind) | |||
54 | return 0; | 54 | return 0; |
55 | } | 55 | } |
56 | 56 | ||
57 | static const struct nla_policy mirred_policy[TCA_MIRRED_MAX + 1] = { | ||
58 | [TCA_MIRRED_PARMS] = { .len = sizeof(struct tc_mirred) }, | ||
59 | }; | ||
60 | |||
57 | static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est, | 61 | static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est, |
58 | struct tc_action *a, int ovr, int bind) | 62 | struct tc_action *a, int ovr, int bind) |
59 | { | 63 | { |
@@ -68,12 +72,11 @@ static int tcf_mirred_init(struct nlattr *nla, struct nlattr *est, | |||
68 | if (nla == NULL) | 72 | if (nla == NULL) |
69 | return -EINVAL; | 73 | return -EINVAL; |
70 | 74 | ||
71 | err = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, NULL); | 75 | err = nla_parse_nested(tb, TCA_MIRRED_MAX, nla, mirred_policy); |
72 | if (err < 0) | 76 | if (err < 0) |
73 | return err; | 77 | return err; |
74 | 78 | ||
75 | if (tb[TCA_MIRRED_PARMS] == NULL || | 79 | if (tb[TCA_MIRRED_PARMS] == NULL) |
76 | nla_len(tb[TCA_MIRRED_PARMS]) < sizeof(*parm)) | ||
77 | return -EINVAL; | 80 | return -EINVAL; |
78 | parm = nla_data(tb[TCA_MIRRED_PARMS]); | 81 | parm = nla_data(tb[TCA_MIRRED_PARMS]); |
79 | 82 | ||