[netcf-devel] MAC lookup, alternative 2

Jonas Eriksson jonas.j.eriksson at ericsson.com
Tue Aug 11 07:48:31 UTC 2009


On Mon, Aug 10, 2009 at 11:13:34PM +0000 David Lutterkort wrote:
> On Wed, 2009-08-05 at 09:37 +0200, Jonas Eriksson wrote:
> > This is another alternative when implementing the MAC lookup.
> 
> I am not clear on where you are trying to go with this. The MAC/iface
> name association should be managed outside the scope of netcf by udev
> rules on modern Linux distributions.

I agree, but I believe that we have different views of what this
implies. To me, it means that MACs are the primary identifiers,
as these determines the interface names. As MACs take precedence
in udev, it should also take precedence when looking up an
interface from netcf.

> When you look an interface up by MAC, netcf looks into /sys to find the
> name of an interface/interfaces with that MAC; when you define an
> interface with a <mac/> tag, the initscripts driver puts a HWADDR entry
> into the config file - that is mostly for documentation purposes, unless
> you do 'ifup <MAC>', that's the only place it is used by the
> initscripts[1].

I am not aware of any other network configuration tool that works
like this. If netcf is a XML frontend för initscripts, that's
fine. But if the aim is World Domination(tm), the MAC should be
used in a way that can be done on all distributions and all
platforms.

Since the HWADDR is mostly ignored, the meaning of the <mac/> tag
becomes "a mac address that would be ignored most of the time but
not if you sidestep netcf on rhel/fedora/centos and run 'ifup
<MAC>'".

> Finally, the one thing that is iffy to me is if dumpxml should report a
> MAC address even if the underlying config file doesn't have a HWADDR
> entry, i.e. should it go to /sys and pull the MAC out ? I don't view
> netcf as a HW enumeration tool, and the iface name/MAC correspondance to
> me falls under HW enumeration.

In the case that the <mac/> tag should be interpreted as HWADDR,
I see your point.

In the other case, if the <mac/> tag should be interpreted as the
lookup alternative that I am arguing for, it could be argued that
this is redundant information. The information would however be
nice for portability reasons. One example is the reinstall
scenario that I raised in another thread. Including this is
tightly coupled with my opinion on the MAC beeing the primary key
to look up an interface, as mentioned above.

> David
> 
> [1] There is of course the possibility that the HWADDR does not match
> the MAC address, in which case 'ifup <MAC>' and 'ifup <NAME>' will
> produce different results, but that's really an instance of 'config is
> broken'

Should this be pointed out by netcf if it happens? If so, looking
up the interface ought to have the same implementation
complexity. 

/Jonas

--
Jonas Eriksson
Consultant at AS/EAB/FLJ/IL
Combitech AB
Älvsjö, Sweden


More information about the netcf-devel mailing list