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