diff options
author | Jamie McClelland <jm@mayfirst.org> | 2011-05-10 17:18:31 -0400 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2011-05-10 18:07:54 -0400 |
commit | 1f71bffdbec1c90bb88c2bae62589180348651a1 (patch) | |
tree | 9da6843369185d60af0258b1eb98529f4247dd60 | |
parent | 96936e80886f4589a025112cff9762cbc6908f14 (diff) | |
download | kvm-manager-1f71bffdbec1c90bb88c2bae62589180348651a1.tar.gz kvm-manager-1f71bffdbec1c90bb88c2bae62589180348651a1.tar.bz2 |
sort -n doesn't properly sort hex values - resulting in duplicate
mac address if the last mac address created ends in 0a (we get 09 as
the last sorted address, hence 0a gets created again).
-rwxr-xr-x | kvm-creator | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kvm-creator b/kvm-creator index 9e2ad41..2428000 100755 --- a/kvm-creator +++ b/kvm-creator @@ -26,7 +26,7 @@ UDEV_RULES_FILE="/etc/udev/rules.d/92-kvm_creator-%s.rules" ls /etc/sv/kvm/* &> /dev/null if [ "$?" -eq 0 ]; then TAP="${5:-tap$(( $( cat /etc/sv/kvm/*/env/TAP | sed 's/^tap//' | sort -n | tail -n 1 ) + 1 ))}" - MAC="${6:-$(printf "%s:%02x" "$(cat /etc/sv/kvm/*/env/MAC | sort | head -n1 | cut -f 1-5 -d: )" "$(( 0x$( cat /etc/sv/kvm/*/env/MAC | cut -f 6 -d: | sort -n | tail -n 1 ) + 1 ))" )}" + MAC="${6:-$(printf "%s:%02x" "$(cat /etc/sv/kvm/*/env/MAC | sort | head -n1 | cut -f 1-5 -d: )" "$(( 0x$( cat /etc/sv/kvm/*/env/MAC | cut -f 6 -d: | sort | tail -n 1 ) + 1 ))" )}" else TAP=tap0 # use a locally-administered MAC address: |