diff options
| -rw-r--r-- | net/ipv6/route.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 2bc91c349273..0458b761f3c5 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
| @@ -4298,19 +4298,13 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, | |||
| 4298 | if (!ipv6_addr_any(&fl6.saddr)) | 4298 | if (!ipv6_addr_any(&fl6.saddr)) |
| 4299 | flags |= RT6_LOOKUP_F_HAS_SADDR; | 4299 | flags |= RT6_LOOKUP_F_HAS_SADDR; |
| 4300 | 4300 | ||
| 4301 | if (!fibmatch) | 4301 | dst = ip6_route_input_lookup(net, dev, &fl6, flags); |
| 4302 | dst = ip6_route_input_lookup(net, dev, &fl6, flags); | ||
| 4303 | else | ||
| 4304 | dst = ip6_route_lookup(net, &fl6, 0); | ||
| 4305 | 4302 | ||
| 4306 | rcu_read_unlock(); | 4303 | rcu_read_unlock(); |
| 4307 | } else { | 4304 | } else { |
| 4308 | fl6.flowi6_oif = oif; | 4305 | fl6.flowi6_oif = oif; |
| 4309 | 4306 | ||
| 4310 | if (!fibmatch) | 4307 | dst = ip6_route_output(net, NULL, &fl6); |
| 4311 | dst = ip6_route_output(net, NULL, &fl6); | ||
| 4312 | else | ||
| 4313 | dst = ip6_route_lookup(net, &fl6, 0); | ||
| 4314 | } | 4308 | } |
| 4315 | 4309 | ||
| 4316 | 4310 | ||
| @@ -4327,6 +4321,15 @@ static int inet6_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, | |||
| 4327 | goto errout; | 4321 | goto errout; |
| 4328 | } | 4322 | } |
| 4329 | 4323 | ||
| 4324 | if (fibmatch && rt->dst.from) { | ||
| 4325 | struct rt6_info *ort = container_of(rt->dst.from, | ||
| 4326 | struct rt6_info, dst); | ||
| 4327 | |||
| 4328 | dst_hold(&ort->dst); | ||
| 4329 | ip6_rt_put(rt); | ||
| 4330 | rt = ort; | ||
| 4331 | } | ||
| 4332 | |||
| 4330 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); | 4333 | skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); |
| 4331 | if (!skb) { | 4334 | if (!skb) { |
| 4332 | ip6_rt_put(rt); | 4335 | ip6_rt_put(rt); |
