On Mon, Jul 31, 2017 at 2:35 PM, David Ahern <dsah...@gmail.com> wrote:
> On 7/30/17 6:51 AM, Xin Long wrote:
>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
>> index 4d30c96..187580f 100644
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
>> @@ -2912,9 +2912,11 @@ static int rtm_to_fib6_config(struct sk_buff *skb, 
>> struct nlmsghdr *nlh,
>>       cfg->fc_dst_len = rtm->rtm_dst_len;
>>       cfg->fc_src_len = rtm->rtm_src_len;
>>       cfg->fc_flags = RTF_UP;
>> -     cfg->fc_protocol = rtm->rtm_protocol;
>>       cfg->fc_type = rtm->rtm_type;
>>
>> +     if (rtm->rtm_protocol != RTPROT_REDIRECT)
>> +             cfg->fc_protocol = rtm->rtm_protocol;
>> +
>>       if (rtm->rtm_type == RTN_UNREACHABLE ||
>>           rtm->rtm_type == RTN_BLACKHOLE ||
>>           rtm->rtm_type == RTN_PROHIBIT ||
Hi, David
>
> Did you look at removing this hunk from rt6_fill_node:
>
>         if (rt->rt6i_flags & RTF_DYNAMIC)
>                 rtm->rtm_protocol = RTPROT_REDIRECT;
>         else if (rt->rt6i_flags & RTF_ADDRCONF) {
>                 if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ROUTEINFO))
>                         rtm->rtm_protocol = RTPROT_RA;
>                 else
>                         rtm->rtm_protocol = RTPROT_KERNEL;
>         }
The issue seems to affect "ip -6 route flush all" as well, not only cache
since 'else if {}' also  causes rtm proto being different from rt6 proto.

>
> And have rtm_protocol set properly on the route when it is installed?
The codes not keeping rtm proto consistent with rt6 proto day 1,
any idea on why it didn't use rt6 proto in kernel properly?

Thanks.

Reply via email to