aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r--net/sched/sch_api.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 98541c6399db..85e73f48e48f 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1311,6 +1311,18 @@ check_loop_fn(struct Qdisc *q, unsigned long cl, struct qdisc_walker *w)
1311 * Delete/get qdisc. 1311 * Delete/get qdisc.
1312 */ 1312 */
1313 1313
1314const struct nla_policy rtm_tca_policy[TCA_MAX + 1] = {
1315 [TCA_KIND] = { .type = NLA_STRING },
1316 [TCA_OPTIONS] = { .type = NLA_NESTED },
1317 [TCA_RATE] = { .type = NLA_BINARY,
1318 .len = sizeof(struct tc_estimator) },
1319 [TCA_STAB] = { .type = NLA_NESTED },
1320 [TCA_DUMP_INVISIBLE] = { .type = NLA_FLAG },
1321 [TCA_CHAIN] = { .type = NLA_U32 },
1322 [TCA_INGRESS_BLOCK] = { .type = NLA_U32 },
1323 [TCA_EGRESS_BLOCK] = { .type = NLA_U32 },
1324};
1325
1314static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n, 1326static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
1315 struct netlink_ext_ack *extack) 1327 struct netlink_ext_ack *extack)
1316{ 1328{
@@ -1327,7 +1339,8 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
1327 !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) 1339 !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN))
1328 return -EPERM; 1340 return -EPERM;
1329 1341
1330 err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL, extack); 1342 err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, rtm_tca_policy,
1343 extack);
1331 if (err < 0) 1344 if (err < 0)
1332 return err; 1345 return err;
1333 1346
@@ -1411,7 +1424,8 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
1411 1424
1412replay: 1425replay:
1413 /* Reinit, just in case something touches this. */ 1426 /* Reinit, just in case something touches this. */
1414 err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL, extack); 1427 err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, rtm_tca_policy,
1428 extack);
1415 if (err < 0) 1429 if (err < 0)
1416 return err; 1430 return err;
1417 1431
@@ -1645,7 +1659,8 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb)
1645 idx = 0; 1659 idx = 0;
1646 ASSERT_RTNL(); 1660 ASSERT_RTNL();
1647 1661
1648 err = nlmsg_parse(nlh, sizeof(struct tcmsg), tca, TCA_MAX, NULL, NULL); 1662 err = nlmsg_parse(nlh, sizeof(struct tcmsg), tca, TCA_MAX,
1663 rtm_tca_policy, NULL);
1649 if (err < 0) 1664 if (err < 0)
1650 return err; 1665 return err;
1651 1666
@@ -1864,7 +1879,8 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n,
1864 !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN)) 1879 !netlink_ns_capable(skb, net->user_ns, CAP_NET_ADMIN))
1865 return -EPERM; 1880 return -EPERM;
1866 1881
1867 err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL, extack); 1882 err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, rtm_tca_policy,
1883 extack);
1868 if (err < 0) 1884 if (err < 0)
1869 return err; 1885 return err;
1870 1886