interface-ip: always override downstream IPv6 mtu
authorHans Dedecker <dedeckeh@gmail.com>
Sun, 5 Aug 2018 12:46:22 +0000 (14:46 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Tue, 7 Aug 2018 20:14:44 +0000 (22:14 +0200)
Always override the downstream IPv6 mtu in case it differs with the IPv6 mtu
of the upstream link. This allows to increase the downstream IPv6 mtu in
case RA messages are received on the upstream link having a mtu attribute
higher than the downstream IPv6 mtu.
At the same be verbose when failing to set the IPv6 mtu on the downstream link.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
interface-ip.c

index b577e66db5b720a00db09dca55903c9fec2f38d8..b7c1807eb1b0bc394943013f17cb8fba8b23058d 100644 (file)
@@ -849,8 +849,11 @@ interface_set_prefix_address(struct device_prefix_assignment *assignment,
                        int mtu = system_update_ipv6_mtu(uplink->l3_dev.dev, 0);
                        int mtu_old = system_update_ipv6_mtu(l3_downlink, 0);
 
-                       if (mtu > 0 && mtu_old > mtu)
-                               system_update_ipv6_mtu(l3_downlink, mtu);
+                       if (mtu > 0 && mtu_old != mtu) {
+                               if (system_update_ipv6_mtu(l3_downlink, mtu) < 0)
+                                       netifd_log_message(L_WARNING, "Failed to set IPv6 mtu to %d"
+                                                       "on interface '%s'\n", mtu, iface->name);
+                       }
                }
 
                assignment->enabled = true;