From: David Ahern <dsahern@gmail.com>
To: Xin Long <lucien.xin@gmail.com>, network dev <netdev@vger.kernel.org>
Cc: davem@davemloft.net, grawity@gmail.com
Subject: Re: [PATCH net] ipv6: set fc_protocol with 0 when rtm_protocol is RTPROT_REDIRECT
Date: Sun, 30 Jul 2017 20:35:08 -0600 [thread overview]
Message-ID: <9fcbffcb-4a14-764c-7fe4-2108b8944c17@gmail.com> (raw)
In-Reply-To: <e9342d18b97fc227cacc19db1b43f4c7350eed3f.1501419097.git.lucien.xin@gmail.com>
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?
next prev parent reply other threads:[~2017-07-31 2:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-30 12:51 [PATCH net] ipv6: set fc_protocol with 0 when rtm_protocol is RTPROT_REDIRECT Xin Long
2017-07-31 2:35 ` David Ahern [this message]
2017-07-31 3:31 ` Xin Long
2017-08-01 0:12 ` David Ahern
2017-08-01 1:40 ` Xin Long
2017-08-01 2:01 ` David Ahern
2017-08-01 2:50 ` Xin Long
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9fcbffcb-4a14-764c-7fe4-2108b8944c17@gmail.com \
--to=dsahern@gmail.com \
--cc=davem@davemloft.net \
--cc=grawity@gmail.com \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).