aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/act_api.c')
-rw-r--r--net/sched/act_api.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 2dfb3e7a040d..d8e0171d9a4b 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -15,6 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/string.h> 16#include <linux/string.h>
17#include <linux/errno.h> 17#include <linux/errno.h>
18#include <linux/slab.h>
18#include <linux/skbuff.h> 19#include <linux/skbuff.h>
19#include <linux/init.h> 20#include <linux/init.h>
20#include <linux/kmod.h> 21#include <linux/kmod.h>
@@ -598,7 +599,7 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,
598 goto errout; 599 goto errout;
599 600
600 /* compat_mode being true specifies a call that is supposed 601 /* compat_mode being true specifies a call that is supposed
601 * to add additional backward compatiblity statistic TLVs. 602 * to add additional backward compatibility statistic TLVs.
602 */ 603 */
603 if (compat_mode) { 604 if (compat_mode) {
604 if (a->type == TCA_OLD_COMPAT) 605 if (a->type == TCA_OLD_COMPAT)
@@ -618,7 +619,8 @@ int tcf_action_copy_stats(struct sk_buff *skb, struct tc_action *a,
618 goto errout; 619 goto errout;
619 620
620 if (gnet_stats_copy_basic(&d, &h->tcf_bstats) < 0 || 621 if (gnet_stats_copy_basic(&d, &h->tcf_bstats) < 0 ||
621 gnet_stats_copy_rate_est(&d, &h->tcf_rate_est) < 0 || 622 gnet_stats_copy_rate_est(&d, &h->tcf_bstats,
623 &h->tcf_rate_est) < 0 ||
622 gnet_stats_copy_queue(&d, &h->tcf_qstats) < 0) 624 gnet_stats_copy_queue(&d, &h->tcf_qstats) < 0)
623 goto errout; 625 goto errout;
624 626
@@ -968,7 +970,7 @@ static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
968 u32 pid = skb ? NETLINK_CB(skb).pid : 0; 970 u32 pid = skb ? NETLINK_CB(skb).pid : 0;
969 int ret = 0, ovr = 0; 971 int ret = 0, ovr = 0;
970 972
971 if (net != &init_net) 973 if (!net_eq(net, &init_net))
972 return -EINVAL; 974 return -EINVAL;
973 975
974 ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL); 976 ret = nlmsg_parse(n, sizeof(struct tcamsg), tca, TCA_ACT_MAX, NULL);
@@ -1051,7 +1053,7 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1051 struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh); 1053 struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh);
1052 struct nlattr *kind = find_dump_kind(cb->nlh); 1054 struct nlattr *kind = find_dump_kind(cb->nlh);
1053 1055
1054 if (net != &init_net) 1056 if (!net_eq(net, &init_net))
1055 return 0; 1057 return 0;
1056 1058
1057 if (kind == NULL) { 1059 if (kind == NULL) {