[ntp:hackers] Correctly detecting interfaces

Brian Utterback brian.utterback at oracle.com
Fri Jul 12 14:54:39 UTC 2013


On 07/12/13 00:02, Danny Mayer wrote:
> On 7/11/2013 11:00 PM, Philip Prindeville wrote:
>> I was looking at lib/isc/unix/ifiter_ioctl.c (et al) works:
>>
>>          if ((ifa->ifa_flags & IFF_UP) != 0)
>>                  iter->current.flags |= INTERFACE_F_UP;
>>
>> and thinking that the semantics aren't exactly right. This checks for the interface being configured, but not necessarily "up" (i.e. having carrier).  I'm thinking a more precise semantic might be:
>>
>>          if ((ifa->ifa_flags & (IFF_UP | IFF_RUNNING)) != (IFF_UP | IFF_RUNNING))
>>                  iter->current.flags |= INTERFACE_F_UP;
>>
>> which requires the interface to be both configured and be active at the physical layer.
>>
>> Anyone have an argument against this proposal?
> I need to object here. Not that you are not apparently right but because
> I seem to recall that there are issues with the UP flag and I don't even
> recall seeing the RUNNING flag. This can be very tricky with different
> Operating Systems/Compilers so you need to look carefully whether or not
> all of them can support this change. These routines come from BIND9 and
> you should look at the versions of them in the latest release of BIND9
> first. These routines are very well maintained by ISC so looking there
> first will be beneficial. Since I was the one who migrated these
> routines into NTP I don't think we have had any issues with them. Is
> there a problem that will be solved by this change?
>
> It's not that you are wrong, but why you think that they should be changed?

Speaking of which, is there any process to get the changes I made to fix 
bug 1485 pushed upstream to the ISC bind people for inclusion in 
subsequent release of BIND? Anyone have a contact?


-- 
blu

Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live. - Martin Golding
-----------------------------------------------------------------------|
Brian Utterback - Solaris RPE, Oracle Corporation.
Ph:603-262-3916, Em:brian.utterback at oracle.com



More information about the hackers mailing list