Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread Martin Lau
On Wed, May 15, 2019 at 06:06:58PM -0600, David Ahern wrote: > On 5/15/19 6:03 PM, Wei Wang wrote: > > Thanks Martin. > > Changing __rt6_find_exception_xxx() might not be easy cause other > > callers of this function does not really need to back off and use > > another saddr. > > And the validation

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread Wei Wang
On Wed, May 15, 2019 at 5:07 PM David Ahern wrote: > > On 5/15/19 6:03 PM, Wei Wang wrote: > > Thanks Martin. > > Changing __rt6_find_exception_xxx() might not be easy cause other > > callers of this function does not really need to back off and use > > another saddr. > > And the validation of the

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread Wei Wang
On Wed, May 15, 2019 at 2:51 PM Martin Lau wrote: > > On Tue, May 14, 2019 at 05:46:10PM -0700, Wei Wang wrote: > > From: Wei Wang > > > > When inserting route cache into the exception table, the key is > > generated with both src_addr and dest_addr with src addr routing. > > However, current log

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread David Ahern
On 5/15/19 6:03 PM, Wei Wang wrote: > Thanks Martin. > Changing __rt6_find_exception_xxx() might not be easy cause other > callers of this function does not really need to back off and use > another saddr. > And the validation of the result is a bit different for different callers. > What about add

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread Martin Lau
On Tue, May 14, 2019 at 05:46:10PM -0700, Wei Wang wrote: > From: Wei Wang > > When inserting route cache into the exception table, the key is > generated with both src_addr and dest_addr with src addr routing. > However, current logic always assumes the src_addr used to generate the > key is a /

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread David Ahern
On 5/15/19 11:45 AM, Wei Wang wrote: >> >> you have to pass in a device. The first line in ip6_del_cached_rt: >> >> if (cfg->fc_ifindex && rt->dst.dev->ifindex != cfg->fc_ifindex) >> goto out; >> >> 'ip route get' is one way to check if it has been deleted. We really >> need to add

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread Wei Wang
From: David Ahern Date: Wed, May 15, 2019 at 10:33 AM To: Wei Wang Cc: Wei Wang, David Miller, Linux Kernel Network Developers, Martin KaFai Lau, Mikael Magnusson, Eric Dumazet > On 5/15/19 11:28 AM, Wei Wang wrote: > > From: Wei Wang > > Date: Wed, May 15, 2019 at 10:25 AM > > To: David Ahern >

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread David Ahern
On 5/15/19 11:28 AM, Wei Wang wrote: > From: Wei Wang > Date: Wed, May 15, 2019 at 10:25 AM > To: David Ahern > Cc: Wei Wang, David Miller, Linux Kernel Network Developers, Martin > KaFai Lau, Mikael Magnusson, Eric Dumazet > >>> >>> What about rt6_remove_exception_rt? >>> >>> You can add a 'cach

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread Wei Wang
From: Wei Wang Date: Wed, May 15, 2019 at 10:25 AM To: David Ahern Cc: Wei Wang, David Miller, Linux Kernel Network Developers, Martin KaFai Lau, Mikael Magnusson, Eric Dumazet > > > > What about rt6_remove_exception_rt? > > > > You can add a 'cache' hook to ip/iproute.c to delete the cached rout

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread Wei Wang
> > What about rt6_remove_exception_rt? > > You can add a 'cache' hook to ip/iproute.c to delete the cached routes > and verify that it works. I seem to have misplaced my patch to do it. I don't think rt6_remove_exception_rt() needs any change. It is because it gets the route cache rt6_info as the

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread David Ahern
On 5/15/19 9:56 AM, David Ahern wrote: > You can add a 'cache' hook to ip/iproute.c to delete the cached routes > and verify that it works. I seem to have misplaced my patch to do it. found it. From 7a328753a93321a07a5228fb32ed881d82d7a537 Mon Sep 17 00:00:00 2001 From: David Ahern Date: Mon, 6 M

Re: [PATCH net] ipv6: fix src addr routing with the exception table

2019-05-15 Thread David Ahern
On 5/14/19 6:46 PM, Wei Wang wrote: > From: Wei Wang > > When inserting route cache into the exception table, the key is > generated with both src_addr and dest_addr with src addr routing. > However, current logic always assumes the src_addr used to generate the > key is a /128 host address. This

[PATCH net] ipv6: fix src addr routing with the exception table

2019-05-14 Thread Wei Wang
From: Wei Wang When inserting route cache into the exception table, the key is generated with both src_addr and dest_addr with src addr routing. However, current logic always assumes the src_addr used to generate the key is a /128 host address. This is not true in the following scenarios: 1. When