diff options
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 5a3e87e4b18f..9af6115f0f50 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -2106,7 +2106,8 @@ static inline size_t rt6_nlmsg_size(void) | |||
2106 | + nla_total_size(sizeof(struct rta_cacheinfo)); | 2106 | + nla_total_size(sizeof(struct rta_cacheinfo)); |
2107 | } | 2107 | } |
2108 | 2108 | ||
2109 | static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt, | 2109 | static int rt6_fill_node(struct net *net, |
2110 | struct sk_buff *skb, struct rt6_info *rt, | ||
2110 | struct in6_addr *dst, struct in6_addr *src, | 2111 | struct in6_addr *dst, struct in6_addr *src, |
2111 | int iif, int type, u32 pid, u32 seq, | 2112 | int iif, int type, u32 pid, u32 seq, |
2112 | int prefix, int nowait, unsigned int flags) | 2113 | int prefix, int nowait, unsigned int flags) |
@@ -2187,8 +2188,9 @@ static int rt6_fill_node(struct sk_buff *skb, struct rt6_info *rt, | |||
2187 | #endif | 2188 | #endif |
2188 | NLA_PUT_U32(skb, RTA_IIF, iif); | 2189 | NLA_PUT_U32(skb, RTA_IIF, iif); |
2189 | } else if (dst) { | 2190 | } else if (dst) { |
2191 | struct inet6_dev *idev = ip6_dst_idev(&rt->u.dst); | ||
2190 | struct in6_addr saddr_buf; | 2192 | struct in6_addr saddr_buf; |
2191 | if (ipv6_dev_get_saddr(ip6_dst_idev(&rt->u.dst)->dev, | 2193 | if (ipv6_dev_get_saddr(net, idev ? idev->dev : NULL, |
2192 | dst, 0, &saddr_buf) == 0) | 2194 | dst, 0, &saddr_buf) == 0) |
2193 | NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf); | 2195 | NLA_PUT(skb, RTA_PREFSRC, 16, &saddr_buf); |
2194 | } | 2196 | } |
@@ -2233,7 +2235,8 @@ int rt6_dump_route(struct rt6_info *rt, void *p_arg) | |||
2233 | } else | 2235 | } else |
2234 | prefix = 0; | 2236 | prefix = 0; |
2235 | 2237 | ||
2236 | return rt6_fill_node(arg->skb, rt, NULL, NULL, 0, RTM_NEWROUTE, | 2238 | return rt6_fill_node(arg->net, |
2239 | arg->skb, rt, NULL, NULL, 0, RTM_NEWROUTE, | ||
2237 | NETLINK_CB(arg->cb->skb).pid, arg->cb->nlh->nlmsg_seq, | 2240 | NETLINK_CB(arg->cb->skb).pid, arg->cb->nlh->nlmsg_seq, |
2238 | prefix, 0, NLM_F_MULTI); | 2241 | prefix, 0, NLM_F_MULTI); |
2239 | } | 2242 | } |
@@ -2299,7 +2302,7 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void | |||
2299 | rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl); | 2302 | rt = (struct rt6_info*) ip6_route_output(net, NULL, &fl); |
2300 | skb->dst = &rt->u.dst; | 2303 | skb->dst = &rt->u.dst; |
2301 | 2304 | ||
2302 | err = rt6_fill_node(skb, rt, &fl.fl6_dst, &fl.fl6_src, iif, | 2305 | err = rt6_fill_node(net, skb, rt, &fl.fl6_dst, &fl.fl6_src, iif, |
2303 | RTM_NEWROUTE, NETLINK_CB(in_skb).pid, | 2306 | RTM_NEWROUTE, NETLINK_CB(in_skb).pid, |
2304 | nlh->nlmsg_seq, 0, 0, 0); | 2307 | nlh->nlmsg_seq, 0, 0, 0); |
2305 | if (err < 0) { | 2308 | if (err < 0) { |
@@ -2326,7 +2329,7 @@ void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info) | |||
2326 | if (skb == NULL) | 2329 | if (skb == NULL) |
2327 | goto errout; | 2330 | goto errout; |
2328 | 2331 | ||
2329 | err = rt6_fill_node(skb, rt, NULL, NULL, 0, | 2332 | err = rt6_fill_node(net, skb, rt, NULL, NULL, 0, |
2330 | event, info->pid, seq, 0, 0, 0); | 2333 | event, info->pid, seq, 0, 0, 0); |
2331 | if (err < 0) { | 2334 | if (err < 0) { |
2332 | /* -EMSGSIZE implies BUG in rt6_nlmsg_size() */ | 2335 | /* -EMSGSIZE implies BUG in rt6_nlmsg_size() */ |