diff options
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 4ef2cfaa3467..5e1c5796761b 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2003,9 +2003,13 @@ errout: | |||
2003 | 2003 | ||
2004 | static int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | 2004 | static int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
2005 | { | 2005 | { |
2006 | struct net *net = skb->sk->sk_net; | ||
2006 | struct fib6_config cfg; | 2007 | struct fib6_config cfg; |
2007 | int err; | 2008 | int err; |
2008 | 2009 | ||
2010 | if (net != &init_net) | ||
2011 | return -EINVAL; | ||
2012 | |||
2009 | err = rtm_to_fib6_config(skb, nlh, &cfg); | 2013 | err = rtm_to_fib6_config(skb, nlh, &cfg); |
2010 | if (err < 0) | 2014 | if (err < 0) |
2011 | return err; | 2015 | return err; |
@@ -2015,9 +2019,13 @@ static int inet6_rtm_delroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *a | |||
2015 | 2019 | ||
2016 | static int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | 2020 | static int inet6_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
2017 | { | 2021 | { |
2022 | struct net *net = skb->sk->sk_net; | ||
2018 | struct fib6_config cfg; | 2023 | struct fib6_config cfg; |
2019 | int err; | 2024 | int err; |
2020 | 2025 | ||
2026 | if (net != &init_net) | ||
2027 | return -EINVAL; | ||
2028 | |||
2021 | err = rtm_to_fib6_config(skb, nlh, &cfg); | 2029 | err = rtm_to_fib6_config(skb, nlh, &cfg); |
2022 | if (err < 0) | 2030 | if (err < 0) |
2023 | return err; | 2031 | return err; |
@@ -2152,6 +2160,7 @@ int rt6_dump_route(struct rt6_info *rt, void *p_arg) | |||
2152 | 2160 | ||
2153 | static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) | 2161 | static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) |
2154 | { | 2162 | { |
2163 | struct net *net = in_skb->sk->sk_net; | ||
2155 | struct nlattr *tb[RTA_MAX+1]; | 2164 | struct nlattr *tb[RTA_MAX+1]; |
2156 | struct rt6_info *rt; | 2165 | struct rt6_info *rt; |
2157 | struct sk_buff *skb; | 2166 | struct sk_buff *skb; |
@@ -2159,6 +2168,9 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void | |||
2159 | struct flowi fl; | 2168 | struct flowi fl; |
2160 | int err, iif = 0; | 2169 | int err, iif = 0; |
2161 | 2170 | ||
2171 | if (net != &init_net) | ||
2172 | return -EINVAL; | ||
2173 | |||
2162 | err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy); | 2174 | err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv6_policy); |
2163 | if (err < 0) | 2175 | if (err < 0) |
2164 | goto errout; | 2176 | goto errout; |