[ds6-devel] Re: is_double_binding_sane

Chris Leishman chris@leishman.org
Sun Dec 29 18:58:30 2002


On Sunday, December 29, 2002, at 08:17 PM, Mauro Tortonesi wrote:
<snip>
> yes, is_ipv6_enabled is not very useful. but IMVHO it's better to 
> reorder
> the addrinfo list returned by getaddrinfo only when it is really 
> needed,
> as we don't know if this breaks the inner working of freeaddrinfo in 
> some
> platform (it shouldn't, however). what do you think about it?

I've thought about it, and I don't think it'll be a problem.  It is 
theoretically possible that getaddrinfo could be implemented in a way 
that isn't compatible with this, but it would be pretty crazy.  We can 
avoid making assumptions about the inner workings of getaddrinfo by 
changing the way we use the results - instead of changing the order we 
loop through multiple times, first for ipv6 then for the rest.  But I 
didn't think it was worth it for now.


>> And "is_double_bind_sane" is a little dangerous IMHO, since it 
>> attempts
>> a bind to 1025 - assuming it will be free, which isn't necessarily 
>> true.
>>
>> Perhaps you need to explain all the logic behind it a bit more?
>
> ooops, i forgot to increment port. it should be fixed now. however, the
> implementation is still buggy because in some cases it fails to detect
> if there is a program bound to the specified port.
>
> perhaps i should borrow some code from netstat to find the first 
> unbounded
> port on the system. what do you think?
>
> in all cases, IMHO we need a function to detect at runtime if the 
> system
> supports double binding.

I _really_ don't like the way this test works....though I am stuck to 
think of a better way to do it.  I think this might be one of those 
rare situations where a autoconf compile time test would be better - 
since platforms aren't likely to change the way they do it....

At the very least, I think this check should ONLY be done if we detect 
a situation in which double binding might have occurred - NOT all the 
time regardless.

Thoughts?  I might do some more research into this and see if there are 
other options.

Chris



More information about the ds6-devel mailing list