interface-ip: fine tune IPv6 mtu warning
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 8 May 2019 19:33:05 +0000 (21:33 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 8 May 2019 19:41:42 +0000 (21:41 +0200)
Failing to set the IPv6 mtu is only a real issue if the mtu to be set is
smaller than the current mtu as in that case it would break IPv6 path mtu;
adapt the logic to generate the warning accordingly

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

index 0721a848befeb522addd2451195d76d14d49be79..6900cd7b92207c0dcba040ca02c25e600c6ee2c7 100644 (file)
@@ -982,7 +982,7 @@ interface_set_prefix_address(struct device_prefix_assignment *assignment,
                        int mtu_old = system_update_ipv6_mtu(l3_downlink, 0);
 
                        if (mtu > 0 && mtu_old != mtu) {
-                               if (system_update_ipv6_mtu(l3_downlink, mtu) < 0)
+                               if (system_update_ipv6_mtu(l3_downlink, mtu) < 0 && mtu < mtu_old)
                                        netifd_log_message(L_WARNING, "Failed to set IPv6 mtu to %d "
                                                        "on interface '%s'\n", mtu, iface->name);
                        }