summaryrefslogtreecommitdiffstats
path: root/rc.inet1
diff options
context:
space:
mode:
authorDarren 'Tadgy' Austin <darren@afterdark.org.uk>2021-03-07 20:42:07 +0000
committerDarren 'Tadgy' Austin <darren@afterdark.org.uk>2021-03-07 20:42:07 +0000
commite8ea45830d8223d2a3b9c25955ce24853650625b (patch)
treee46242722c50a60a85f50643d336fddbc1a5bd32 /rc.inet1
parent3e1ccbec898c6bff7755061bfe698b8004b4d994 (diff)
downloadslacknetsetup-e8ea45830d8223d2a3b9c25955ce24853650625b.tar.xz
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.
Diffstat (limited to 'rc.inet1')
-rw-r--r--rc.inet18
1 files 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.