}
#endif
+static_inline int
+rxi_IsLoopbackIface(struct sockaddr_in *a, unsigned long flags)
+{
+ afs_uint32 addr = ntohl(a->sin_addr.s_addr);
+ if (rx_IsLoopbackAddr(addr)) {
+ return 1;
+ }
+ if ((flags & IFF_LOOPBACK) && ((addr & 0xff000000) == 0x7f000000)) {
+ return 1;
+ }
+ return 0;
+}
/* this function returns the total number of interface addresses
** the buffer has to be passed in by the caller
if (count >= maxSize) /* no more space */
dpf(("Too many interfaces..ignoring 0x%x\n",
a->sin_addr.s_addr));
- else if (!loopbacks && rx_IsLoopbackAddr(ntohl(a->sin_addr.s_addr))) {
+ else if (!loopbacks && rxi_IsLoopbackIface(a, ifm->ifm_flags)) {
addrcount--;
continue; /* skip loopback address as well. */
} else if (loopbacks && ifm->ifm_flags & IFF_LOOPBACK) {
}
if (a->sin_addr.s_addr != 0) {
if (!loopbacks) {
- if (rx_IsLoopbackAddr(ntohl(a->sin_addr.s_addr)))
+ if (rxi_IsLoopbackIface(a, ifr->ifr_flags))
continue; /* skip loopback address as well. */
} else {
if (ifr->ifr_flags & IFF_LOOPBACK)