* [PATCH net] net/ipv6: Only update MTU metric if it set
@ 2018-08-30 21:15 dsahern
2018-08-30 21:49 ` Jan Janssen
2018-09-02 21:04 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: dsahern @ 2018-08-30 21:15 UTC (permalink / raw)
To: netdev; +Cc: medhefgo, David Ahern
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,
--
2.15.2 (Apple Git-101.1)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] net/ipv6: Only update MTU metric if it set
2018-08-30 21:15 [PATCH net] net/ipv6: Only update MTU metric if it set dsahern
@ 2018-08-30 21:49 ` Jan Janssen
2018-08-30 22:13 ` David Ahern
2018-09-02 21:04 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Jan Janssen @ 2018-08-30 21:49 UTC (permalink / raw)
To: dsahern; +Cc: netdev, David Ahern
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net/ipv6: Only update MTU metric if it set
2018-08-30 21:49 ` Jan Janssen
@ 2018-08-30 22:13 ` David Ahern
0 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2018-08-30 22:13 UTC (permalink / raw)
To: Jan Janssen; +Cc: netdev
On 8/30/18 3:49 PM, Jan Janssen wrote:
> 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.
It is silly in the sense that systemd-networkd installs a default route
with an MTU and then pushes down updates (route replace) without the MTU.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] net/ipv6: Only update MTU metric if it set
2018-08-30 21:15 [PATCH net] net/ipv6: Only update MTU metric if it set dsahern
2018-08-30 21:49 ` Jan Janssen
@ 2018-09-02 21:04 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2018-09-02 21:04 UTC (permalink / raw)
To: dsahern; +Cc: netdev, medhefgo, dsahern
From: dsahern@kernel.org
Date: Thu, 30 Aug 2018 14:15:43 -0700
> 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>
Applied and queued up for -stable, thanks David.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-03 1:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-30 21:15 [PATCH net] net/ipv6: Only update MTU metric if it set dsahern
2018-08-30 21:49 ` Jan Janssen
2018-08-30 22:13 ` David Ahern
2018-09-02 21:04 ` David Miller
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).