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, 10 insertions, 0 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 72cdb0fade20..852829139c67 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -18,6 +18,8 @@
18#include <linux/skbuff.h> 18#include <linux/skbuff.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/kmod.h> 20#include <linux/kmod.h>
21#include <net/net_namespace.h>
22#include <net/sock.h>
21#include <net/sch_generic.h> 23#include <net/sch_generic.h>
22#include <net/act_api.h> 24#include <net/act_api.h>
23#include <net/netlink.h> 25#include <net/netlink.h>
@@ -924,10 +926,14 @@ done:
924 926
925static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, void *arg) 927static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
926{ 928{
929 struct net *net = skb->sk->sk_net;
927 struct rtattr **tca = arg; 930 struct rtattr **tca = arg;
928 u32 pid = skb ? NETLINK_CB(skb).pid : 0; 931 u32 pid = skb ? NETLINK_CB(skb).pid : 0;
929 int ret = 0, ovr = 0; 932 int ret = 0, ovr = 0;
930 933
934 if (net != &init_net)
935 return -EINVAL;
936
931 if (tca[TCA_ACT_TAB-1] == NULL) { 937 if (tca[TCA_ACT_TAB-1] == NULL) {
932 printk("tc_ctl_action: received NO action attribs\n"); 938 printk("tc_ctl_action: received NO action attribs\n");
933 return -EINVAL; 939 return -EINVAL;
@@ -997,6 +1003,7 @@ find_dump_kind(struct nlmsghdr *n)
997static int 1003static int
998tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb) 1004tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
999{ 1005{
1006 struct net *net = skb->sk->sk_net;
1000 struct nlmsghdr *nlh; 1007 struct nlmsghdr *nlh;
1001 unsigned char *b = skb_tail_pointer(skb); 1008 unsigned char *b = skb_tail_pointer(skb);
1002 struct rtattr *x; 1009 struct rtattr *x;
@@ -1006,6 +1013,9 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
1006 struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh); 1013 struct tcamsg *t = (struct tcamsg *) NLMSG_DATA(cb->nlh);
1007 struct rtattr *kind = find_dump_kind(cb->nlh); 1014 struct rtattr *kind = find_dump_kind(cb->nlh);
1008 1015
1016 if (net != &init_net)
1017 return 0;
1018
1009 if (kind == NULL) { 1019 if (kind == NULL) {
1010 printk("tc_dump_action: action bad kind\n"); 1020 printk("tc_dump_action: action bad kind\n");
1011 return 0; 1021 return 0;