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 ||

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;
        }

And have rtm_protocol set properly on the route when it is installed?

Reply via email to