[asterisk-dev] IPv4 and IPv6 preference

Simon Perreault simon.perreault at viagenie.ca
Mon Jul 19 07:58:46 CDT 2010


On 2010-07-19 08:53, Klaus Darilion wrote:
> What is the default bindaddr? 0.0.0.0 or :: ?

It is 0.0.0.0. See here:

> [simon at ringo trunk]$ grep bindaddr configs/sip.conf.sample 
> udpbindaddr=0.0.0.0             ; IP address to bind UDP listen socket to (0.0.0.0 binds to all)
> tcpbindaddr=0.0.0.0             ; IP address for TCP server to bind to (0.0.0.0 binds to all interfaces)
> ;tlsbindaddr=0.0.0.0            ; IP address for TLS server to bind to (0.0.0.0) binds to all interfaces)


> I think, even if bindaddr is ::, it should be checked if the server
> really has a global IPv6 address - not only a link-local address, before
> trying to send SIP over v6.

I disagree.

- Since bindaddr=0.0.0.0 by default, one must consciously set it to an
IPv6 address to enable IPv6. We can expect such a person who consciously
enables IPv6 to also fix its IPv6 configuration.

- IPv6 address that are configured on a system may change dynamically.
We don't want to perform the numerous ioctls required to check that
there is a global-scope IPv6 address on the system each time we have a
packet to send. Doing it periodically would not solve the problem
completely.

- Trying to work around a broken setup this way would be a disservice to
users. We want users to notice bugs in their setup and fix them. Users
don't want Asterisk to try to outsmart them.

Here's an alternative proposal: when parsing the configuration, if
bindaddr=::, check that there is indeed a non-link-local address
configured on the system. If not, print a warning, and continue on your way.

(This check could also be done for IPv4, by the way. There is nothing
specific to IPv6 here.)

It is perfectly valid, and I can imagine circumstances where I would
want to do it, to have Asterisk bind on a link-local address.

Simon
-- 
NAT64/DNS64 open-source --> http://ecdysis.viagenie.ca
STUN/TURN server        --> http://numb.viagenie.ca
vCard 4.0               --> http://www.vcarddav.org



More information about the asterisk-dev mailing list