All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Janssen <medhefgo@web.de>
To: dsahern@kernel.org
Cc: netdev@vger.kernel.org, David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH net] net/ipv6: Only update MTU metric if it set
Date: Thu, 30 Aug 2018 23:49:08 +0200	[thread overview]
Message-ID: <11723218.PRMC7IWbep@minako> (raw)
In-Reply-To: <20180830211543.27111-1-dsahern@kernel.org>

On Donnerstag, 30. August 2018 23:15:43 CEST dsahern@kernel.org wrote:
> From: David Ahern <dsahern@gmail.com>
> 
> Jan reported a regression after an update to 4.18.5. In this case ipv6
> default route is setup by systemd-networkd based on data from an RA. The
> RA contains an MTU of 1492 which is used when the route is first inserted
> but then systemd-networkd pushes down updates to the default route
> without the mtu set.
> 
> Prior to the change to fib6_info, metrics such as MTU were held in the
> dst_entry and rt6i_pmtu in rt6_info contained an update to the mtu if
> any. ip6_mtu would look at rt6i_pmtu first and use it if set. If not,
> the value from the metrics is used if it is set and finally falling
> back to the idev value.
> 
> After the fib6_info change metrics are contained in the fib6_info struct
> and there is no equivalent to rt6i_pmtu. To maintain consistency with
> the old behavior the new code should only reset the MTU in the metrics
> if the route update has it set.
> 
> Fixes: d4ead6b34b67 ("net/ipv6: move metrics from dst to rt6_info")
> Reported-by: Jan Janssen <medhefgo@web.de>
> Signed-off-by: David Ahern <dsahern@gmail.com>
> ---
>  net/ipv6/ip6_fib.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
> index d212738e9d10..f43d278e0040 100644
> --- a/net/ipv6/ip6_fib.c
> +++ b/net/ipv6/ip6_fib.c
> @@ -987,7 +987,10 @@ static int fib6_add_rt2node(struct fib6_node *fn,
> struct fib6_info *rt, fib6_clean_expires(iter);
>  				else
>  					fib6_set_expires(iter, rt->expires);
> -				fib6_metric_set(iter, RTAX_MTU, rt->fib6_pmtu);
> +
> +				if (rt->fib6_pmtu)
> +					fib6_metric_set(iter, RTAX_MTU,
> +							rt->fib6_pmtu);
>  				return -EEXIST;
>  			}
>  			/* If we have the same destination and the same metric,

I just tested this and can confirm that it fixes my problem.

You mentioned that systemd-networkd is doing something silly here, so I was 
wondering if you could make a bug report to fix the underlying issue? I don't 
mind doing it myself but you're the expert and can explain things better.

Thank you for fixing this.

  reply	other threads:[~2018-08-31  1:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-30 21:15 [PATCH net] net/ipv6: Only update MTU metric if it set dsahern
2018-08-30 21:49 ` Jan Janssen [this message]
2018-08-30 22:13   ` David Ahern
2018-09-02 21:04 ` David Miller

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=11723218.PRMC7IWbep@minako \
    --to=medhefgo@web.de \
    --cc=dsahern@gmail.com \
    --cc=dsahern@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.