aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2006-07-01 04:29:21 +0000
committerBill Nottingham <notting@redhat.com>2006-07-01 04:29:21 +0000
commit9ecfaf89a85ca92a1c6c7d93b9addc25e7b27da0 (patch)
tree707f356b8887f5604d0938477dac802230ebd802
parent50c2561c4272b00d7f90b45d39cdfcfad8d5e45d (diff)
downloadinitscripts-9ecfaf89a85ca92a1c6c7d93b9addc25e7b27da0.tar
initscripts-9ecfaf89a85ca92a1c6c7d93b9addc25e7b27da0.tar.gz
initscripts-9ecfaf89a85ca92a1c6c7d93b9addc25e7b27da0.tar.bz2
initscripts-9ecfaf89a85ca92a1c6c7d93b9addc25e7b27da0.tar.xz
initscripts-9ecfaf89a85ca92a1c6c7d93b9addc25e7b27da0.zip
ignore alias devices (#186355)
refresh the device name on collision, as it may have initialized since we initially scanned for devices
-rw-r--r--src/rename_device.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rename_device.c b/src/rename_device.c
index 9db4d41f..00b14475 100644
--- a/src/rename_device.c
+++ b/src/rename_device.c
@@ -142,6 +142,9 @@ struct netdev *get_configs() {
for (i = 0; lines[i]; i++) {
if (g_str_has_prefix(lines[i],"DEVICE=")) {
devname = lines[i] + 7;
+ /* ignore alias devices */
+ if (strchr(devname,':'))
+ devname = NULL;
}
if (g_str_has_prefix(lines[i],"HWADDR=")) {
hwaddr = lines[i] + 7;
@@ -230,8 +233,12 @@ void rename_device(char *src, char *target, struct netdev *current) {
struct netdev *i, *tmpdev;
hw = get_hwaddr(target);
- if (!hw)
- return;
+ if (!hw) {
+ devs = get_devs();
+ hw = get_hwaddr(target);
+ if (!hw)
+ return;
+ }
nconfig = get_config_by_hwaddr(hw);
curdev = get_device_by_hwaddr(hw);