summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/ip_helper_generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'pjlib/src/pj/ip_helper_generic.c')
-rw-r--r--pjlib/src/pj/ip_helper_generic.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pjlib/src/pj/ip_helper_generic.c b/pjlib/src/pj/ip_helper_generic.c
index 6eaba54a..6a3d19e7 100644
--- a/pjlib/src/pj/ip_helper_generic.c
+++ b/pjlib/src/pj/ip_helper_generic.c
@@ -85,14 +85,17 @@ static pj_status_t if_enum_by_af(int af,
continue; /* Skip when interface is down */
}
+#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF
if (it->ifa_flags & IFF_LOOPBACK) {
TRACE_((THIS_FILE, " loopback interface"));
continue; /* Skip loopback interface */
}
+#endif
if (ad==NULL) {
TRACE_((THIS_FILE, " NULL address ignored"));
- continue; /* reported to happen on Linux 2.6.25.9 */
+ continue; /* reported to happen on Linux 2.6.25.9
+ with ppp interface */
}
if (ad->sa_family != af) {
@@ -188,10 +191,12 @@ static pj_status_t if_enum_by_af(int af,
continue; /* Skip when interface is down */
}
+#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF
if (itf->ifr_flags & IFF_LOOPBACK) {
TRACE_((THIS_FILE, " loopback interface"));
continue; /* Skip loopback interface */
}
+#endif
/* Ignore 0.0.0.0/8 address. This is a special address
* which doesn't seem to have practical use.
@@ -259,10 +264,12 @@ static pj_status_t if_enum_by_af(int af, unsigned *p_cnt, pj_sockaddr ifs[])
continue; /* Skip when interface is down */
}
+#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF
if (ifreq.ifr_flags & IFF_LOOPBACK) {
TRACE_((THIS_FILE, " loopback interface"));
continue; /* Skip loopback interface */
}
+#endif
/* Note: SIOCGIFADDR does not work for IPv6! */
if ((rc=ioctl(sock, SIOCGIFADDR, &ifreq)) != 0) {