From e8ea45830d8223d2a3b9c25955ce24853650625b Mon Sep 17 00:00:00 2001 From: Darren 'Tadgy' Austin Date: Sun, 7 Mar 2021 20:42:07 +0000 Subject: Don't bring up a bridge interface if it will be brought up later by IP config. This fixes a bug where SLAAC would take a while to be effective when the interface is already up. Thanks to davjohn on LQ for the report. --- rc.inet1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rc.inet1 b/rc.inet1 index 3529868..b8be188 100644 --- a/rc.inet1 +++ b/rc.inet1 @@ -160,8 +160,12 @@ br_open() { /sbin/ip link set dev ${IFNAME[$1]} type bridge $IFOPT fi done <<<"${IFOPTS[$i]/%|*([[:blank:]])}|" # The | on the end is required. - debug_log "/sbin/ip link set dev ${IFNAME[$1]} up" - /sbin/ip link set dev ${IFNAME[$1]} up + # Don't bring up the interface if it will be brought up later during IP configuration. + # This prevents a situation where SLAAC takes a while to apply if the interface is already up. + if [ -z "${IPADDRS[$1]}" ] && [ -z "${IP6ADDRS[$1]}" ] && [ -z "${IPADDR[$1]}" ] && [ "${USE_DHCP[$1]}" != "yes" ] && [ "${USE_DHCP6[$1]}" != "yes" ] && [ "${USE_SLAAC[$1]}" != "yes" ]; then + debug_log "/sbin/ip link set dev ${IFNAME[$1]} up" + /sbin/ip link set dev ${IFNAME[$1]} up + fi } # Function to disassemble a bridge interface. -- cgit v1.2.3