diff options
Diffstat (limited to 'net/sched/sch_api.c')
-rw-r--r-- | net/sched/sch_api.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index a07d55e75698..400769014bbd 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -1084,7 +1084,7 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n) | |||
1084 | struct Qdisc *p = NULL; | 1084 | struct Qdisc *p = NULL; |
1085 | int err; | 1085 | int err; |
1086 | 1086 | ||
1087 | if ((n->nlmsg_type != RTM_GETQDISC) && !capable(CAP_NET_ADMIN)) | 1087 | if ((n->nlmsg_type != RTM_GETQDISC) && !netlink_capable(skb, CAP_NET_ADMIN)) |
1088 | return -EPERM; | 1088 | return -EPERM; |
1089 | 1089 | ||
1090 | err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL); | 1090 | err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL); |
@@ -1151,7 +1151,7 @@ static int tc_modify_qdisc(struct sk_buff *skb, struct nlmsghdr *n) | |||
1151 | struct Qdisc *q, *p; | 1151 | struct Qdisc *q, *p; |
1152 | int err; | 1152 | int err; |
1153 | 1153 | ||
1154 | if (!capable(CAP_NET_ADMIN)) | 1154 | if (!netlink_capable(skb, CAP_NET_ADMIN)) |
1155 | return -EPERM; | 1155 | return -EPERM; |
1156 | 1156 | ||
1157 | replay: | 1157 | replay: |
@@ -1304,6 +1304,7 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, | |||
1304 | struct gnet_dump d; | 1304 | struct gnet_dump d; |
1305 | struct qdisc_size_table *stab; | 1305 | struct qdisc_size_table *stab; |
1306 | 1306 | ||
1307 | cond_resched(); | ||
1307 | nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags); | 1308 | nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags); |
1308 | if (!nlh) | 1309 | if (!nlh) |
1309 | goto out_nlmsg_trim; | 1310 | goto out_nlmsg_trim; |
@@ -1435,9 +1436,9 @@ static int tc_dump_qdisc(struct sk_buff *skb, struct netlink_callback *cb) | |||
1435 | s_idx = cb->args[0]; | 1436 | s_idx = cb->args[0]; |
1436 | s_q_idx = q_idx = cb->args[1]; | 1437 | s_q_idx = q_idx = cb->args[1]; |
1437 | 1438 | ||
1438 | rcu_read_lock(); | ||
1439 | idx = 0; | 1439 | idx = 0; |
1440 | for_each_netdev_rcu(net, dev) { | 1440 | ASSERT_RTNL(); |
1441 | for_each_netdev(net, dev) { | ||
1441 | struct netdev_queue *dev_queue; | 1442 | struct netdev_queue *dev_queue; |
1442 | 1443 | ||
1443 | if (idx < s_idx) | 1444 | if (idx < s_idx) |
@@ -1460,8 +1461,6 @@ cont: | |||
1460 | } | 1461 | } |
1461 | 1462 | ||
1462 | done: | 1463 | done: |
1463 | rcu_read_unlock(); | ||
1464 | |||
1465 | cb->args[0] = idx; | 1464 | cb->args[0] = idx; |
1466 | cb->args[1] = q_idx; | 1465 | cb->args[1] = q_idx; |
1467 | 1466 | ||
@@ -1491,7 +1490,7 @@ static int tc_ctl_tclass(struct sk_buff *skb, struct nlmsghdr *n) | |||
1491 | u32 qid; | 1490 | u32 qid; |
1492 | int err; | 1491 | int err; |
1493 | 1492 | ||
1494 | if ((n->nlmsg_type != RTM_GETTCLASS) && !capable(CAP_NET_ADMIN)) | 1493 | if ((n->nlmsg_type != RTM_GETTCLASS) && !netlink_capable(skb, CAP_NET_ADMIN)) |
1495 | return -EPERM; | 1494 | return -EPERM; |
1496 | 1495 | ||
1497 | err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL); | 1496 | err = nlmsg_parse(n, sizeof(*tcm), tca, TCA_MAX, NULL); |
@@ -1618,6 +1617,7 @@ static int tc_fill_tclass(struct sk_buff *skb, struct Qdisc *q, | |||
1618 | struct gnet_dump d; | 1617 | struct gnet_dump d; |
1619 | const struct Qdisc_class_ops *cl_ops = q->ops->cl_ops; | 1618 | const struct Qdisc_class_ops *cl_ops = q->ops->cl_ops; |
1620 | 1619 | ||
1620 | cond_resched(); | ||
1621 | nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags); | 1621 | nlh = nlmsg_put(skb, portid, seq, event, sizeof(*tcm), flags); |
1622 | if (!nlh) | 1622 | if (!nlh) |
1623 | goto out_nlmsg_trim; | 1623 | goto out_nlmsg_trim; |