Module: kamailio
Branch: master
Commit: a5b1099c9061551a0b31db8ef88efb2e376b290c
URL:
https://github.com/kamailio/kamailio/commit/a5b1099c9061551a0b31db8ef88efb2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-10-16T10:49:16+02:00
core: socket info - skip ipv6 link local on interface discovery
---
Modified: src/core/socket_info.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a5b1099c9061551a0b31db8ef88efb2…
Patch:
https://github.com/kamailio/kamailio/commit/a5b1099c9061551a0b31db8ef88efb2…
---
diff --git a/src/core/socket_info.c b/src/core/socket_info.c
index 4142ab17dce..80f72870e79 100644
--- a/src/core/socket_info.c
+++ b/src/core/socket_info.c
@@ -1763,6 +1763,16 @@ int add_interfaces(char *if_name, int family, unsigned short port,
continue;
if(family && family != ifa->ifa_addr->sa_family)
continue;
+ if(ifa->ifa_addr->sa_family == AF_INET6) {
+ struct sockaddr_in6 *caddr = (struct sockaddr_in6 *)ifa->ifa_addr;
+ if((sr_bind_ipv6_link_local & KSR_IPV6_LINK_LOCAL_SKIP)
+ && IN6_IS_ADDR_LINKLOCAL(&(caddr->sin6_addr))) {
+ LM_DBG("skipping iface [%s] fam: [%x] flg: [%lx] addr: [%s]\n",
+ ifa->ifa_name, ifa->ifa_addr->sa_family,
+ (unsigned long)ifa->ifa_flags, tmp);
+ continue;
+ }
+ }
sockaddr2ip_addr(&addr, (struct sockaddr *)ifa->ifa_addr);
tmp = ip_addr2a(&addr);
if(ifa->ifa_flags & IFF_LOOPBACK)