[et-mgmt-tools] [PATCH] comparing MAC address is changed to case insensitive

Richard W.M. Jones rjones at redhat.com
Fri Apr 11 11:42:52 UTC 2008


On Fri, Apr 11, 2008 at 09:22:33AM +0900, Hiroyuki Kaguchi wrote:
> MAC address is case sensitive in "countMACaddr" method.
> This patch changes from case sensitive to case insensitive.

You also have to note that 1:2:3:4:5:6 is the same as
01:02:03:04:05:06.  Comparing MAC addresses is hard :-)

There's some C code in libvirt (src/utils.c IIRC) which Jim Meyering
wrote that does a correct compare on MAC addresses.  Should be easier
in Python 'coz you can split the string and compare each component
numerically.

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v




More information about the et-mgmt-tools mailing list