From 25585eb6b99922c6a6527a2359712bfb0f315ac6 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 15 Apr 2025 10:58:48 +0200 Subject: [PATCH] interfaces: consider tracked interface's linked devices on reload #7713 When attaching a GIF tunnel to an IPv6 device it's more likely a LAN device but that is being missed when WAN is reloaded here. Much of the other code still accounts for this so this merely goes with the flow and since we only operate in IPv6 scope that is ok. --- src/etc/rc.newwanipv6 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/etc/rc.newwanipv6 b/src/etc/rc.newwanipv6 index a2f7c195e..3ad42f4d3 100755 --- a/src/etc/rc.newwanipv6 +++ b/src/etc/rc.newwanipv6 @@ -2,7 +2,7 @@ + * Copyright (C) 2017-2025 Franco Fichtner * Copyright (C) 2006 Scott Ullrich * Copyright (C) 2003-2005 Manuel Kasper * All rights reserved. @@ -91,8 +91,17 @@ log_msg("IP renewal starting (address: {$ip}, interface: {$interface}, device: { interfaces_vips_configure($interface, 6); -$greifs = link_interface_to_gre($interface, true, 6); -$gififs = link_interface_to_gif($interface, true, 6); +$auxdevs = []; + +/* find and reconfigure all linked devices which includes looking up tracked interfaces */ +foreach (array_merge([$interface], array_keys(link_interface_to_track6($interface))) as $allif) { + foreach (link_interface_to_gre($allif, true, 6) as $linked) { + $auxdevs[] = $linked; + } + foreach (link_interface_to_gif($allif, true, 6) as $linked) { + $auxdevs[] = $linked; + } +} switch (isset($config['system']['ipv6allow']) ? ($config['interfaces'][$interface]['ipaddrv6'] ?? 'none') : 'none') { case 'slaac': @@ -111,7 +120,8 @@ switch (isset($config['system']['ipv6allow']) ? ($config['interfaces'][$interfac break; } -interfaces_restart_by_device(false, array_merge($greifs, $gififs)); +/* linked devices that are assigned need to be reconfigured now */ +interfaces_restart_by_device(false, $auxdevs); $interfaces = array_keys(link_interface_to_track6($interface, true)); array_unshift($interfaces, $interface);