[libvirt] Re: [netcf-devel] Multiple interfaces with identical mac-addresses

Dave Allan dallan at redhat.com
Thu Jun 25 14:28:58 UTC 2009


Laine Stump wrote:
> (expanding Cc to include libvir-list, because this is more of a libvirt 
> issue)
> 
> On 06/24/2009 01:52 PM, David Lutterkort wrote:
>> On Wed, 2009-06-24 at 18:22 +0100, Daniel P. Berrange wrote:
>>  
>>> On Wed, Jun 24, 2009 at 10:20:00AM -0700, David Lutterkort wrote:
>>>    
>>>> On Tue, 2009-06-23 at 21:47 +0100, Daniel P. Berrange wrote:
>>>>      
>>>>> Why would we ever have duplicate MAC addresses?
>>>>>         
>>>> VLANs:
>>>>
>>>>         # vconfig add eth0 42
>>>>         #  cat /sys/class/net/eth0.42/address         00:15:58:81:5b:0e
>>>>         # cat /sys/class/net/eth0/address            00:15:58:81:5b:0e
>>>>       
>>> Ok, so for the libvirt API we should define that the lookup-by-mac API
>>> will not return VLAN devices, since we cant provide a 1-1 lookup there
>>>     
>>
>> Why would you do that ? When the user asks for interfaces with a MAC,
>> you don't know if they are looking for a VLAN or base device. If they
>> want the VLAN, how would they look that up ?
>>   
> 
> 
> I think we need to do one of two things:
> 
> 
> 1) Modify the existing virInterfaceLookupByMACString() api to return a 
> list of virInterfaces. Although the public API has been in one release, 
> there has been no functionality behind the API, so there's nobody using 
> it as it is, and nobody is going to expect to use it as it is either. 
> Because of that, "backward compatibility" isn't as much of an issue, and 
> maybe we could let this modification to the API slide.
> 
> 2) If we want to be really anal, we could modify 
> virInterfaceLookupByMACString() to return an error if there are multiple 
> interfaces with that particular MAC address, then provide a new function 
> (name suggestion?) that would return a list of interfaces.

I haven't actually dug out the relevant network specs, but IIRC it's 
legal to use duplicate mac addresses on different interfaces as long as 
they are in separate broadcast domains, so this discussion can't be 
limited to VLANs.  Also alias interfaces have the same mac as the original.

Dave




More information about the libvir-list mailing list