Peter Memishian writes:
>
> > Now that I understand the purpose of these addresses better, I would
> > omit the check for IFF_LOOPBACK. Not only is it redundant with the
> > address check, but it actually doesn't tell you what you wanted to
> > know (any more than a name check would)
>
> But, if you actually wanted to ignore the loopback interface (I agree that
> it's probably not what they want), checking IFF_LOOPBACK is preferable to
> checking the name. Even if we presume that lo0 will only ever mean
> loopback, I've seen a lot of places botch these checks and instead treat
> everything that starts with the letters "lo" as loopback (grrr!)
That's the point. They don't want to ignore the loopback interface,
because someone could be doing this with a routable address:
ifconfig lo0 addif 10.0.0.1 up
That's what I meant by saying "now that I understand the purpose" in
that response above. The original code just did a strcmp on "lo0",
which clearly wasn't right, but it took a while to figure out what
*was* right, and I don't now think that includes IFF_LOOPBACK. A test
for that bit would have been good if the original code had been right,
but it wasn't.
--
James Carlson, Solaris Networking <[EMAIL PROTECTED]>
Sun Microsystems / 35 Network Drive 71.232W Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757 42.496N Fax +1 781 442 1677
_______________________________________________
networking-discuss mailing list
[email protected]