Module: kamailio
Branch: 4.4
Commit: 49ec5fa5d9bb939b80ef3994b5f0c04e7525ab9f
URL:
https://github.com/kamailio/kamailio/commit/49ec5fa5d9bb939b80ef3994b5f0c04…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2016-04-07T09:59:17+02:00
core: common check for ifa->ifa_addr in add_intefaces
- if no ip address associated with the network interface, it is not
useful anyhow
(cherry picked from commit c395ae00d7970be0a857265e9324a50bcb00f4d0)
---
Modified: socket_info.c
---
Diff:
https://github.com/kamailio/kamailio/commit/49ec5fa5d9bb939b80ef3994b5f0c04…
Patch:
https://github.com/kamailio/kamailio/commit/49ec5fa5d9bb939b80ef3994b5f0c04…
---
diff --git a/socket_info.c b/socket_info.c
index 95c6ee6..aa8928a 100644
--- a/socket_info.c
+++ b/socket_info.c
@@ -1205,9 +1205,12 @@ int add_interfaces(char* if_name, int family, unsigned short port,
for (ifa = ifap; ifa; ifa = ifa->ifa_next)
{
+ /* skip if no IP addr associated with the interface */
+ if (ifa->ifa_addr==0)
+ continue;
#ifdef AF_PACKET
/* skip AF_PACKET addr family since it is of no use later on */
- if (ifa->ifa_addr && ifa->ifa_addr->sa_family == AF_PACKET)
+ if (ifa->ifa_addr->sa_family == AF_PACKET)
continue;
#endif
if (if_name && strcmp(if_name, ifa->ifa_name))