|
31 | 31 | #include <net/pkt_sched.h>
|
32 | 32 | #include <net/pkt_cls.h>
|
33 | 33 |
|
| 34 | +extern const struct nla_policy rtm_tca_policy[TCA_MAX + 1]; |
| 35 | + |
34 | 36 | /* The list of all installed classifier types */
|
35 | 37 | static LIST_HEAD(tcf_proto_base);
|
36 | 38 |
|
@@ -1211,7 +1213,7 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
|
1211 | 1213 | replay:
|
1212 | 1214 | tp_created = 0;
|
1213 | 1215 |
|
1214 |
| - err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, NULL, extack); |
| 1216 | + err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, rtm_tca_policy, extack); |
1215 | 1217 | if (err < 0)
|
1216 | 1218 | return err;
|
1217 | 1219 |
|
@@ -1360,7 +1362,7 @@ static int tc_del_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
|
1360 | 1362 | if (!netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN))
|
1361 | 1363 | return -EPERM;
|
1362 | 1364 |
|
1363 |
| - err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, NULL, extack); |
| 1365 | + err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, rtm_tca_policy, extack); |
1364 | 1366 | if (err < 0)
|
1365 | 1367 | return err;
|
1366 | 1368 |
|
@@ -1475,7 +1477,7 @@ static int tc_get_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
|
1475 | 1477 | void *fh = NULL;
|
1476 | 1478 | int err;
|
1477 | 1479 |
|
1478 |
| - err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, NULL, extack); |
| 1480 | + err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, rtm_tca_policy, extack); |
1479 | 1481 | if (err < 0)
|
1480 | 1482 | return err;
|
1481 | 1483 |
|
@@ -1838,7 +1840,7 @@ static int tc_ctl_chain(struct sk_buff *skb, struct nlmsghdr *n,
|
1838 | 1840 | return -EPERM;
|
1839 | 1841 |
|
1840 | 1842 | replay:
|
1841 |
| - err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, NULL, extack); |
| 1843 | + err = nlmsg_parse(n, sizeof(*t), tca, TCA_MAX, rtm_tca_policy, extack); |
1842 | 1844 | if (err < 0)
|
1843 | 1845 | return err;
|
1844 | 1846 |
|
@@ -1949,7 +1951,8 @@ static int tc_dump_chain(struct sk_buff *skb, struct netlink_callback *cb)
|
1949 | 1951 | if (nlmsg_len(cb->nlh) < sizeof(*tcm))
|
1950 | 1952 | return skb->len;
|
1951 | 1953 |
|
1952 |
| - err = nlmsg_parse(cb->nlh, sizeof(*tcm), tca, TCA_MAX, NULL, NULL); |
| 1954 | + err = nlmsg_parse(cb->nlh, sizeof(*tcm), tca, TCA_MAX, rtm_tca_policy, |
| 1955 | + NULL); |
1953 | 1956 | if (err)
|
1954 | 1957 | return err;
|
1955 | 1958 |
|
|
0 commit comments