chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09c0310
)
rule_generator/write_net_rules: prevent interface to be named "eth"
author
Harald Hoyer
<harald@redhat.com>
Tue, 10 Aug 2010 14:48:37 +0000
(16:48 +0200)
committer
Harald Hoyer
<harald@redhat.com>
Tue, 10 Aug 2010 14:48:37 +0000
(16:48 +0200)
find_next_available() would return "eth" instead of "eth0"
extras/rule_generator/write_net_rules
patch
|
blob
|
history
diff --git
a/extras/rule_generator/write_net_rules
b/extras/rule_generator/write_net_rules
index 644fbcecbae847565cc4ee0e9cb470a686687e72..437979241fbf0b920aeb809af12a7508f331b953 100644
(file)
--- 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