You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.7 KiB
41 lines
1.7 KiB
From 0506080aee1da03e867b1ab3f182d19bfbeae443 Mon Sep 17 00:00:00 2001 |
|
From: Harald Hoyer <harald@redhat.com> |
|
Date: Fri, 4 Apr 2014 12:52:39 +0200 |
|
Subject: [PATCH] ifcfg: only bind to HWADDR, if addr_assign_type == 0 |
|
|
|
/sys/class/net/$netif/addr_assign_type is != 0 for random MAC address |
|
interfaces |
|
|
|
(cherry picked from commit 2e094b20a6875fdb0a7ef8772e3d7688ad91c036) |
|
--- |
|
modules.d/40network/net-lib.sh | 3 --- |
|
modules.d/45ifcfg/write-ifcfg.sh | 2 ++ |
|
2 files changed, 2 insertions(+), 3 deletions(-) |
|
|
|
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh |
|
index 5d4ae32c..d53e1a6e 100755 |
|
--- a/modules.d/40network/net-lib.sh |
|
+++ b/modules.d/40network/net-lib.sh |
|
@@ -518,9 +518,6 @@ find_iface_with_link() { |
|
} |
|
|
|
is_persistent_ethernet_name() { |
|
- [ -f /sys/class/net/$netif/addr_assign_type ] || return 1 |
|
- [ "$(cat /sys/class/net/$netif/addr_assign_type)" = "0" ] || return 1 |
|
- |
|
case "$1" in |
|
# udev persistent interface names |
|
eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]*) |
|
diff --git a/modules.d/45ifcfg/write-ifcfg.sh b/modules.d/45ifcfg/write-ifcfg.sh |
|
index 2631fbe2..5dc351d5 100755 |
|
--- a/modules.d/45ifcfg/write-ifcfg.sh |
|
+++ b/modules.d/45ifcfg/write-ifcfg.sh |
|
@@ -166,6 +166,8 @@ for netup in /tmp/net.*.did-setup ; do |
|
if ! print_s390 $netif; then |
|
if [ -z "$macaddr" ] && \ |
|
! is_persistent_ethernet_name "$netif" && \ |
|
+ [ -f /sys/class/net/$netif/addr_assign_type ] && \ |
|
+ [ "$(cat /sys/class/net/$netif/addr_assign_type)" = "0" ] && \ |
|
[ -f /sys/class/net/$netif/address ]; then |
|
echo "HWADDR=\"$(cat /sys/class/net/$netif/address)\"" |
|
fi
|
|
|