aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index a21021bf1409..1d2839571d2f 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2527,6 +2527,7 @@ nla_put_failure:
2527 2527
2528static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg) 2528static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void *arg)
2529{ 2529{
2530 struct net *net = in_skb->sk->sk_net;
2530 struct rtmsg *rtm; 2531 struct rtmsg *rtm;
2531 struct nlattr *tb[RTA_MAX+1]; 2532 struct nlattr *tb[RTA_MAX+1];
2532 struct rtable *rt = NULL; 2533 struct rtable *rt = NULL;
@@ -2536,6 +2537,9 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
2536 int err; 2537 int err;
2537 struct sk_buff *skb; 2538 struct sk_buff *skb;
2538 2539
2540 if (net != &init_net)
2541 return -EINVAL;
2542
2539 err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv4_policy); 2543 err = nlmsg_parse(nlh, sizeof(*rtm), tb, RTA_MAX, rtm_ipv4_policy);
2540 if (err < 0) 2544 if (err < 0)
2541 goto errout; 2545 goto errout;