[sr-dev] git:master:8102ca5f: core: Don't bind to IPv6 addresses if auto_bind_ipv6 is disabled

Alex Hermann alex at speakup.nl
Tue Aug 30 13:51:41 CEST 2016


Module: kamailio
Branch: master
Commit: 8102ca5f67de979a3597a97f96a05c99d13fb29d
URL: https://github.com/kamailio/kamailio/commit/8102ca5f67de979a3597a97f96a05c99d13fb29d

Author: Alex Hermann <alex at speakup.nl>
Committer: Alex Hermann <alex at 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/8102ca5f67de979a3597a97f96a05c99d13fb29d.diff
Patch: https://github.com/kamailio/kamailio/commit/8102ca5f67de979a3597a97f96a05c99d13fb29d.patch

---

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,




More information about the sr-dev mailing list