[Home]

Summary:ASTERISK-25077: use IP_FREEBIND on network sockets
Reporter:Gergely Dömsödi (doome)Labels:
Date Opened:2015-05-11 07:28:37Date Closed:2015-05-15 16:21:47
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_pjsip Channels/chan_sip/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:As systemd is getting more and more widespread on servers too, it is not unusual that asterisk starts before all the network interfaces are up and running. If bind address is used in any config file (eg. sip.conf or pjsip conf), there is a chance that asterisk cannot bind properly on that specific address. Currently It starts without properly binding on the address/port given in the configuration.

Since Linux 2.4, there is a socket option IP_FREEBIND, which solves this problem by allowing programs to bind to specific addresses even when they are not present on the system.

I think it should be considered to use this option on every network socket. While systemd itself have its own way of saying "start this service after the network is up", it is not bullet proof, and relies heavily on using some network managment tool (eg. NetworkManager), which, especially on servers  is not used in all cases, thus the ip_freebind solution would make asterisk more robust.

http://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
http://man7.org/linux/man-pages/man7/ip.7.html
Comments:By: Rusty Newton (rnewton) 2015-05-15 16:21:13.321-0500

Features requests without patches are not accepted through the issue tracker. Features requests are openly discussed on the mailing lists, forums, and IRC [1]. Please see the Asterisk Issue Guidelines [2] for more information on feature request and patch submission.

[1] http://asterisk.org/community/discuss
[2] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines