From 46ca0aff06247f8a97367a153a7d605b75d87e81 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 15 Aug 2022 09:11:36 +0200 Subject: [PATCH] interfaces: static handling is the same as dynamic Tiptoeing around interface_configure() when the resulting work is the same is counter-intuitive and the static ARP case probably has some more side effects since we do not check for static ARP flag?! filter_configure() can take a long time. Skip alias stuff. --- src/etc/rc.linkup | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/src/etc/rc.linkup b/src/etc/rc.linkup index 5a8b0814f..c0ea9feb9 100755 --- a/src/etc/rc.linkup +++ b/src/etc/rc.linkup @@ -58,48 +58,24 @@ function handle_argument_group($action, $realif) return; } - $ipaddr = '0.0.0.0'; - $ip6addr = '::'; - - if (isset($config['interfaces'][$interface]['ipaddr'])) { - $ipaddr = $config['interfaces'][$interface]['ipaddr']; - } - - if (isset($config['interfaces'][$interface]['ipaddrv6'])) { - $ip6addr = $config['interfaces'][$interface]['ipaddrv6']; - } - - $is_static = is_ipaddrv4($ipaddr) && is_ipaddrv6($ip6addr); - switch ($action) { case 'stop': log_error(sprintf( - "DEVD: Ethernet detached event for %s %s(%s)", - $is_static ? 'static' : 'dynamic', + "DEVD: Ethernet detached event for %s(%s)", $interface, $realif )); - if ($is_static) { - interfaces_staticarp_configure($interface); - } else { - interface_bring_down($interface); - filter_configure(); - } + interface_bring_down($interface); + filter_configure(false, false); break; case 'start': log_error(sprintf( - "DEVD: Ethernet attached event for %s %s(%s)", - $is_static ? 'static' : 'dynamic', + "DEVD: Ethernet attached event for %s(%s)", $interface, $realif )); - if ($is_static) { - interfaces_staticarp_configure($interface); - configdp_run('interface newip', array($realif)); - } else { - interface_configure(false, $interface, true, true); - filter_configure(); - } + interface_configure(false, $interface, true, true); + filter_configure(false, false); break; default: log_error("DEVD: The action parameter passed is wrong ($action)");