e83cdd
From 7c35556da4c803bbb08c96e96262e598d5c42274 Mon Sep 17 00:00:00 2001
e83cdd
From: Harald Hoyer <harald@redhat.com>
e83cdd
Date: Tue, 21 Aug 2018 13:14:44 +0200
e83cdd
Subject: [PATCH] network: skip already enslaved interfaces
e83cdd
e83cdd
(cherry picked from commit f6e3b59e5ea6f52a25631557badc7f4dfabbd7ee)
e83cdd
e83cdd
Resolves: #1625042
e83cdd
---
e83cdd
 modules.d/35network-legacy/ifup.sh | 6 +++++-
e83cdd
 modules.d/40network/net-lib.sh     | 7 +++++++
e83cdd
 2 files changed, 12 insertions(+), 1 deletion(-)
e83cdd
e83cdd
diff --git a/modules.d/35network-legacy/ifup.sh b/modules.d/35network-legacy/ifup.sh
e83cdd
index ea2a67ff..b4f5bf10 100755
e83cdd
--- a/modules.d/35network-legacy/ifup.sh
e83cdd
+++ b/modules.d/35network-legacy/ifup.sh
e83cdd
@@ -408,7 +408,11 @@ for p in $(getargs ip=); do
e83cdd
     esac
e83cdd
 
e83cdd
     # If this option isn't directed at our interface, skip it
e83cdd
-    [ -n "$dev" ] && [ "$dev" != "$netif" ] && continue
e83cdd
+    if [ -n "$dev" ]; then
e83cdd
+        [ "$dev" != "$netif" ] && continue
e83cdd
+    else
e83cdd
+        iface_is_enslaved "$netif" && continue
e83cdd
+    fi
e83cdd
 
e83cdd
     # Store config for later use
e83cdd
     for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do
e83cdd
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
e83cdd
index 7b93f25e..f9569573 100755
e83cdd
--- a/modules.d/40network/net-lib.sh
e83cdd
+++ b/modules.d/40network/net-lib.sh
e83cdd
@@ -745,6 +745,13 @@ iface_has_link() {
e83cdd
     iface_has_carrier "$@"
e83cdd
 }
e83cdd
 
e83cdd
+iface_is_enslaved() {
e83cdd
+    local _li
e83cdd
+    _li=$(ip -o link show dev $1)
e83cdd
+    strstr "$li" " master " || return 1
e83cdd
+    return 0
e83cdd
+}
e83cdd
+
e83cdd
 find_iface_with_link() {
e83cdd
     local iface_path="" iface=""
e83cdd
     for iface_path in /sys/class/net/*; do
e83cdd