for (cp = (char *)ifc.ifc_buf, cplim = ifc.ifc_buf + ifc.ifc_len;
cp < cplim;
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
- cp += _SIZEOF_ADDR_IFREQ(*ifr))
+ cp += _SIZEOF_ADDR_IFREQ(*ifr)
#else
#ifdef AFS_AIX51_ENV
- cp = cpnext)
+ cp = cpnext
#else
- cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a)))
+ cp += sizeof(ifr->ifr_name) + MAX(a->sin_len, sizeof(*a))
#endif
#endif
+ )
+#else
+ for (i = 0; i < len; ++i)
+#endif
{
+#if defined(AFS_AIX41_ENV) || defined (AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
ifr = (struct ifreq *)cp;
#else
- for (i = 0; i < len; ++i) {
ifr = &ifs[i];
#endif
a = (struct sockaddr_in *)&ifr->ifr_addr;
continue; /* ignore this address */
}
if (a->sin_addr.s_addr != 0) {
- if (!loopbacks && (ifr->ifr_flags & IFF_LOOPBACK)) {
- continue; /* skip aliased loopbacks as well. */
+ if (!loopbacks) {
+ if (a->sin_addr.s_addr == htonl(0x7f000001))
+ continue; /* skip loopback address as well. */
+ } else {
+ if (ifr->ifr_flags & IFF_LOOPBACK)
+ continue; /* skip aliased loopbacks as well. */
}
if (count >= maxSize) /* no more space */
printf("Too many interfaces..ignoring 0x%x\n",