diff options
Diffstat (limited to 'net/decnet/dn_route.c')
-rw-r--r-- | net/decnet/dn_route.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index 2a5bb0714c7e..28aeba15cf12 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c | |||
@@ -1511,6 +1511,7 @@ rtattr_failure: | |||
1511 | */ | 1511 | */ |
1512 | static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg) | 1512 | static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void *arg) |
1513 | { | 1513 | { |
1514 | struct net *net = in_skb->sk->sk_net; | ||
1514 | struct rtattr **rta = arg; | 1515 | struct rtattr **rta = arg; |
1515 | struct rtmsg *rtm = NLMSG_DATA(nlh); | 1516 | struct rtmsg *rtm = NLMSG_DATA(nlh); |
1516 | struct dn_route *rt = NULL; | 1517 | struct dn_route *rt = NULL; |
@@ -1519,6 +1520,9 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void | |||
1519 | struct sk_buff *skb; | 1520 | struct sk_buff *skb; |
1520 | struct flowi fl; | 1521 | struct flowi fl; |
1521 | 1522 | ||
1523 | if (net != &init_net) | ||
1524 | return -EINVAL; | ||
1525 | |||
1522 | memset(&fl, 0, sizeof(fl)); | 1526 | memset(&fl, 0, sizeof(fl)); |
1523 | fl.proto = DNPROTO_NSP; | 1527 | fl.proto = DNPROTO_NSP; |
1524 | 1528 | ||
@@ -1596,10 +1600,14 @@ out_free: | |||
1596 | */ | 1600 | */ |
1597 | int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb) | 1601 | int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb) |
1598 | { | 1602 | { |
1603 | struct net *net = skb->sk->sk_net; | ||
1599 | struct dn_route *rt; | 1604 | struct dn_route *rt; |
1600 | int h, s_h; | 1605 | int h, s_h; |
1601 | int idx, s_idx; | 1606 | int idx, s_idx; |
1602 | 1607 | ||
1608 | if (net != &init_net) | ||
1609 | return 0; | ||
1610 | |||
1603 | if (NLMSG_PAYLOAD(cb->nlh, 0) < sizeof(struct rtmsg)) | 1611 | if (NLMSG_PAYLOAD(cb->nlh, 0) < sizeof(struct rtmsg)) |
1604 | return -EINVAL; | 1612 | return -EINVAL; |
1605 | if (!(((struct rtmsg *)NLMSG_DATA(cb->nlh))->rtm_flags&RTM_F_CLONED)) | 1613 | if (!(((struct rtmsg *)NLMSG_DATA(cb->nlh))->rtm_flags&RTM_F_CLONED)) |