Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1635192
| From | David Ahern <dsahern@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: net/ipv6: GPF in rt6_device_match |
| Date | 2017-05-03 20:30 +0200 |
| Message-ID | <tD7ce-Ai-11@gated-at.bofh.it> (permalink) |
| References | <tD5tL-7R3-1@gated-at.bofh.it> <tD5WO-8gC-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 5/3/17 11:02 AM, Cong Wang wrote:
> A quick glance shows we need to simply check local->rt6i_idev
> since we do the same check for sprt right above.
As I recall, rt6i_idev is set for all routes except null_entry and it is
not set on null_entry only because of initialization order.
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index a1bf426..61ec3c8 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -511,7 +511,7 @@ static inline struct rt6_info
> *rt6_device_match(struct net *net,
> sprt->rt6i_idev->dev->ifindex != oif) {
> if (flags & RT6_LOOKUP_F_IFACE)
> continue;
> - if (local &&
> + if (local && local->rt6i_idev &&
>
> local->rt6i_idev->dev->ifindex == oif)
> continue;
> }
>
Or don't consider null_entry at all:
@@ -515,7 +528,8 @@ static inline struct rt6_info
*rt6_device_match(struct net *net,
local->rt6i_idev->dev->ifindex == oif)
continue;
}
- local = sprt;
+ if (sprt != net->ipv6.ip6_null_entry)
+ local = sprt;
}
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: net/ipv6: GPF in rt6_device_match Cong Wang <xiyou.wangcong@gmail.com> - 2017-05-03 19:10 +0200
Re: net/ipv6: GPF in rt6_device_match David Ahern <dsahern@gmail.com> - 2017-05-03 20:30 +0200
Re: net/ipv6: GPF in rt6_device_match Cong Wang <xiyou.wangcong@gmail.com> - 2017-05-04 00:10 +0200
Re: net/ipv6: GPF in rt6_device_match David Ahern <dsahern@gmail.com> - 2017-05-04 00:10 +0200
Re: net/ipv6: GPF in rt6_device_match Cong Wang <xiyou.wangcong@gmail.com> - 2017-05-04 01:40 +0200
Re: net/ipv6: GPF in rt6_device_match David Ahern <dsahern@gmail.com> - 2017-05-04 04:50 +0200
Re: net/ipv6: GPF in rt6_device_match Cong Wang <xiyou.wangcong@gmail.com> - 2017-05-04 06:00 +0200
Re: net/ipv6: GPF in rt6_device_match David Ahern <dsahern@gmail.com> - 2017-05-04 06:20 +0200
csiph-web