tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: getifaddrs(3) returns 2 AF_LINK instances for the same interface

David Young wrote:
> I don't know.  You will have to find out.  IIRC, one of the AF_LINK
> records produced by getifaddrs(3) has the wrong netmask (should be
> all-1s), and the other has the struct if_data filled out.  I don't know
> remember what other differences there are.

Do you mean the AF_LINK with the netmask is wrong?

>> How is userland supposed to pick the right AF_LINK or are they both right?
> I guess it depends on your purposes which is right.  There may be more
> than two AF_LINK ifaddrs on an interface, BTW.

You mean two different if_data structures?
In simple terms, >1 hardware address? Interesting. So I need to check
for dups regardless of this outcome then.

>>> Have another look at the doco and source for getifaddrs(3).  I think
>>> that if there is a bug, you will find it there.
>> I have checked and the last change of note was over 7 years ago.
>> So are you suggesting that getifaddrs(3) should ignore the _IFINFO  
>> message or somehow merge it into the _NEWADDR one - if it's present?
> Based on my recollections, above, my guess is that getifaddrs(3) should
> merge the messages.

If we can have different AF_LINK addrs on the same interface then I how
would I know which AF_LINK addr was in _IFINFO so I could merge in the
correct data?



Home | Main Index | Thread Index | Old Index