Module: kamailio Branch: master Commit: fd95b95035a7da088a94888132326d463191da83 URL: https://github.com/kamailio/kamailio/commit/fd95b95035a7da088a94888132326d46...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2024-09-12T16:23:02+02:00
core: socket info - set address also for link local items
- updates to log messages
---
Modified: src/core/socket_info.c
---
Diff: https://github.com/kamailio/kamailio/commit/fd95b95035a7da088a94888132326d46... Patch: https://github.com/kamailio/kamailio/commit/fd95b95035a7da088a94888132326d46...
---
diff --git a/src/core/socket_info.c b/src/core/socket_info.c index 120f99b1e49..4cf1693560a 100644 --- a/src/core/socket_info.c +++ b/src/core/socket_info.c @@ -1574,24 +1574,24 @@ static int build_iface_list(void) for(; RTA_OK(rtap, rtl); rtap = RTA_NEXT(rtap, rtl)) { switch(rtap->rta_type) { case IFA_ADDRESS: + inet_ntop(families[i], RTA_DATA(rtap), entry->addr, + MAX_IF_LEN); if((*(int *)RTA_DATA(rtap)) == htons(0xfe80)) { - LM_DBG("Link Local Address, ignoring ...\n"); + LM_DBG("Link Local Address is '%s'\n", entry->addr); is_link_local = 1; - break; } - inet_ntop(families[i], RTA_DATA(rtap), entry->addr, - MAX_IF_LEN); - LM_DBG("iface <IFA_ADDRESS> addr is %s\n", + LM_DBG("iface <IFA_ADDRESS> address is '%s'\n", entry->addr); break; case IFA_LOCAL: + inet_ntop(families[i], RTA_DATA(rtap), entry->addr, + MAX_IF_LEN); if((*(int *)RTA_DATA(rtap)) == htons(0xfe80)) { - LM_DBG("Link Local Address, ignoring ...\n"); + LM_DBG("Link Local Address is '%s'\n", entry->addr); is_link_local = 1; } - inet_ntop(families[i], RTA_DATA(rtap), entry->addr, - MAX_IF_LEN); - LM_DBG("iface <IFA_LOCAL> addr is %s\n", entry->addr); + LM_DBG("iface <IFA_LOCAL> address is '%s'\n", + entry->addr); break; case IFA_LABEL: LM_DBG("iface name is %s\n", (char *)RTA_DATA(rtap)); @@ -1691,7 +1691,7 @@ int add_interfaces_via_netlink(char *if_name, int family, unsigned short port, if(family && family == tmp->family) { /* check if loopback */ if(ifaces[i].flags & IFF_LOOPBACK) { - LM_DBG("INTERFACE '%s' is loopback", ifaces[i].name); + LM_DBG("INTERFACE '%s' is loopback\n", ifaces[i].name); flags |= SI_IS_LO; } /* save the info */