Module: kamailio
Branch: master
Commit: 8102ca5f67de979a3597a97f96a05c99d13fb29d
URL:
https://github.com/kamailio/kamailio/commit/8102ca5f67de979a3597a97f96a05c9…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: 2016-08-02T12:48:29+02:00
core: Don't bind to IPv6 addresses if auto_bind_ipv6 is disabled
With the following listen statement:
listen=udp:eth0:5060
Kamailio would try to bind to the IPv6 address(es) on that interface and fail with:
ERROR: <core> [udp_server.c:369]: udp_init(): might be caused by using a link local
address, try site local or global
---
Modified: socket_info.c
---
Diff:
https://github.com/kamailio/kamailio/commit/8102ca5f67de979a3597a97f96a05c9…
Patch:
https://github.com/kamailio/kamailio/commit/8102ca5f67de979a3597a97f96a05c9…
---
diff --git a/socket_info.c b/socket_info.c
index aa8928a..ee48e11 100644
--- a/socket_info.c
+++ b/socket_info.c
@@ -1406,8 +1406,8 @@ static int fix_socket_list(struct socket_info **list, int*
type_flags)
for (si=*list;si;){
next=si->next;
ai_lst=0;
- if (add_interfaces(si->name.s, 0, si->port_no,
- si->proto, &ai_lst)!=-1){
+ if (add_interfaces(si->name.s, auto_bind_ipv6 ? 0 : AF_INET,
+ si->port_no, si->proto, &ai_lst)!=-1){
if (si->flags & SI_IS_MHOMED){
if((new_si=new_sock2list_after(ai_lst->name.s, 0, si->port_no,
si->proto, si->useinfo.name.s,