diff options
author | Darren 'Tadgy' Austin <darren@afterdark.org.uk> | 2021-03-07 20:42:07 +0000 |
---|---|---|
committer | Darren 'Tadgy' Austin <darren@afterdark.org.uk> | 2021-03-07 20:42:07 +0000 |
commit | e8ea45830d8223d2a3b9c25955ce24853650625b (patch) | |
tree | e46242722c50a60a85f50643d336fddbc1a5bd32 | |
parent | 3e1ccbec898c6bff7755061bfe698b8004b4d994 (diff) | |
download | slacknetsetup-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.
-rw-r--r-- | rc.inet1 | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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. |