Module: kamailio
Branch: master
Commit: 69b87dd212313635fda0e31c287591e8fd0e0166
URL:
https://github.com/kamailio/kamailio/commit/69b87dd212313635fda0e31c287591e…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-05-21T17:26:14+02:00
core: copy discovered interface name only when its len is > 0
---
Modified: src/core/socket_info.c
---
Diff:
https://github.com/kamailio/kamailio/commit/69b87dd212313635fda0e31c287591e…
Patch:
https://github.com/kamailio/kamailio/commit/69b87dd212313635fda0e31c287591e…
---
diff --git a/src/core/socket_info.c b/src/core/socket_info.c
index 472be175c0..ee2a543289 100644
--- a/src/core/socket_info.c
+++ b/src/core/socket_info.c
@@ -1155,6 +1155,7 @@ static int build_iface_list(void)
entry->ifa_flags = ifi->ifa_flags;
is_link_local = 0;
+ name[0] = '\0';
for(;RTA_OK(rtap, rtl);rtap=RTA_NEXT(rtap,rtl)){
switch(rtap->rta_type){
case IFA_ADDRESS:
@@ -1194,8 +1195,9 @@ static int build_iface_list(void)
}
}
- if(strlen(ifaces[index].name)==0)
+ if(strlen(ifaces[index].name)==0 && strlen(name)>0) {
strncpy(ifaces[index].name, name, MAX_IF_LEN-1);
+ }
ifaces[index].index = index;