From a7b446f6d3e676cd5b94aa916ceefdf631facbfc Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 11 Mar 2022 08:12:47 +0100 Subject: [PATCH] interfaces: issues with assigned gif/gre tunnels #5540 We still need this code because the current logic of resolving dependencies is flawed. At least we do not start GIF/GRE more than twice now. --- src/etc/inc/interfaces.inc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index ee2f221f4..90e6a33f7 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -2230,6 +2230,26 @@ function interface_configure($verbose = false, $interface = 'wan', $reload = fal /* XXX maybe spoofmac, media and promisc can live here too? */ configure_interface_hardware($realhwif, $ifconfig_details); + /* + * Make sure tunnel address is set when interface is configured as + * these lie outside the normal ipaddr/ipaddrv6 configuration schema. + * + * Actually this does not fix what the previous comment states: + * + * Here we repair the situation where virtual devices have been + * set up before their dependent interfaces have actually been + * configured before they are allowed to be configured due to + * long dependency: hwdev -> lan -> gifdev -> opt1 + * + * For legacy reasons opt1 is configured before lan due to IPv6 + * tracking decisions in interfaces_configure() which leads to + * a defunct tunnel if we do not restart it here. + * + * Eventually this should go away as the second half of ticket #5540. + */ + interfaces_gre_configure($realhwif); + interfaces_gif_configure($realhwif); + switch ($wancfg['ipaddr']) { case 'dhcp': interface_dhcp_configure($interface);