summaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2010-08-10 16:48:37 +0200
committerHarald Hoyer <harald@redhat.com>2010-08-10 16:48:37 +0200
commitef5304bc8ddda1917143e96bc3addeb5a09588c6 (patch)
treeb8b9c5d4fb4c49597469f7ce7d068a34f8f15d3a /extras
parent09c03103028011935044bbade29a602925898f27 (diff)
rule_generator/write_net_rules: prevent interface to be named "eth"
find_next_available() would return "eth" instead of "eth0"
Diffstat (limited to 'extras')
-rw-r--r--extras/rule_generator/write_net_rules2
1 files changed, 2 insertions, 0 deletions
diff --git a/extras/rule_generator/write_net_rules b/extras/rule_generator/write_net_rules
index 644fbcecba..437979241f 100644
--- a/extras/rule_generator/write_net_rules
+++ b/extras/rule_generator/write_net_rules
@@ -128,6 +128,8 @@ else
# if a rule using the current name already exists, find a new name
if interface_name_taken; then
INTERFACE="$basename$(find_next_available "$basename[0-9]*")"
+ # prevent INTERFACE from being "eth" instead of "eth0"
+ [ "$INTERFACE" = "${INTERFACE%%[ \[\]0-9]*}" ] && INTERFACE=${INTERFACE}0
echo "INTERFACE_NEW=$INTERFACE"
fi
fi