Re: [PATCH net] ipv6: remove null_entry before adding default route

2018-01-07 Thread Wei Wang
On Sat, Jan 6, 2018 at 10:16 PM, Martin KaFai Lau wrote: > On Sat, Jan 06, 2018 at 05:41:28PM -0800, Wei Wang wrote: >> On Fri, Jan 5, 2018 at 11:42 PM, Martin KaFai Lau wrote: >> > On Fri, Jan 05, 2018 at 05:38:35PM -0800, Wei Wang wrote: >> >> From: Wei Wang >> >> >> >> In the current code, wh

Re: [PATCH net] ipv6: remove null_entry before adding default route

2018-01-06 Thread Martin KaFai Lau
On Sat, Jan 06, 2018 at 05:41:28PM -0800, Wei Wang wrote: > On Fri, Jan 5, 2018 at 11:42 PM, Martin KaFai Lau wrote: > > On Fri, Jan 05, 2018 at 05:38:35PM -0800, Wei Wang wrote: > >> From: Wei Wang > >> > >> In the current code, when creating a new fib6 table, tb6_root.leaf gets > >> initialized

Re: [PATCH net] ipv6: remove null_entry before adding default route

2018-01-06 Thread Wei Wang
On Fri, Jan 5, 2018 at 11:42 PM, Martin KaFai Lau wrote: > On Fri, Jan 05, 2018 at 05:38:35PM -0800, Wei Wang wrote: >> From: Wei Wang >> >> In the current code, when creating a new fib6 table, tb6_root.leaf gets >> initialized to net->ipv6.ip6_null_entry. >> If a default route is being added wit

Re: [PATCH net] ipv6: remove null_entry before adding default route

2018-01-05 Thread Martin KaFai Lau
On Fri, Jan 05, 2018 at 05:38:35PM -0800, Wei Wang wrote: > From: Wei Wang > > In the current code, when creating a new fib6 table, tb6_root.leaf gets > initialized to net->ipv6.ip6_null_entry. > If a default route is being added with rt->rt6i_metric = 0x, > fib6_add() will add this route

[PATCH net] ipv6: remove null_entry before adding default route

2018-01-05 Thread Wei Wang
From: Wei Wang In the current code, when creating a new fib6 table, tb6_root.leaf gets initialized to net->ipv6.ip6_null_entry. If a default route is being added with rt->rt6i_metric = 0x, fib6_add() will add this route after net->ipv6.ip6_null_entry. As null_entry is shared, it could cau