]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
network: skip already enslaved interfaces
authorHarald Hoyer <harald@redhat.com>
Tue, 21 Aug 2018 11:14:44 +0000 (13:14 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Tue, 4 Dec 2018 07:50:42 +0000 (08:50 +0100)
modules.d/35network-legacy/ifup.sh
modules.d/40network/net-lib.sh

index ea2a67ff0ad28a74031e8404165e19a03de8d1d2..b4f5bf106c65751f269bf33f39b9107cff24d80f 100755 (executable)
@@ -408,7 +408,11 @@ for p in $(getargs ip=); do
     esac
 
     # If this option isn't directed at our interface, skip it
-    [ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
+    if [ -n "$dev" ]; then
+        [ "$dev" != "$netif" ] && continue
+    else
+        iface_is_enslaved "$netif" && continue
+    fi
 
     # Store config for later use
     for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do
index 1e7f1b330250ff4502250c5eb4146c07f573b53c..964ed3ab81576d5c70f4262c62ef64bc02da084f 100755 (executable)
@@ -745,6 +745,13 @@ iface_has_link() {
     iface_has_carrier "$@"
 }
 
+iface_is_enslaved() {
+    local _li
+    _li=$(ip -o link show dev $1)
+    strstr "$li" " master " || return 1
+    return 0
+}
+
 find_iface_with_link() {
     local iface_path="" iface=""
     for iface_path in /sys/class/net/*; do