]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
getaddr-avoid-looping-20060615
authorDerrick Brashear <shadow@dementia.org>
Thu, 15 Jun 2006 16:12:13 +0000 (16:12 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 15 Jun 2006 16:12:13 +0000 (16:12 +0000)
so it would be good to count these all off

oops

src/rx/rx_getaddr.c

index 17993af1e88dfa2569bae29057859cb8074f9add..3f5390713254cbafdcc6ac96c8d396a8b6ee00fe 100644 (file)
@@ -206,11 +206,13 @@ rx_getAllAddr_internal(afs_int32 buffer[], int maxSize, int loopbacks)
            if (count >= maxSize)       /* no more space */
                dpf(("Too many interfaces..ignoring 0x%x\n",
                       a->sin_addr.s_addr));
-           else if (!loopbacks && a->sin_addr.s_addr == htonl(0x7f000001)) 
+           else if (!loopbacks && a->sin_addr.s_addr == htonl(0x7f000001)) {
+               addrcount--;
                continue;       /* skip loopback address as well. */
-           else if (loopbacks && ifm->ifm_flags & IFF_LOOPBACK) 
+           } else if (loopbacks && ifm->ifm_flags & IFF_LOOPBACK) {
+               addrcount--;
                continue;       /* skip aliased loopbacks as well. */
-           else
+           else
                buffer[count++] = a->sin_addr.s_addr;
            addrcount--;
            ifam = (struct ifa_msghdr *)((char *)ifam + ifam->ifam_msglen);