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

oops

(cherry picked from commit 2e691074fb6ce70e8352da3e57a746a77f7489f1)

src/rx/rx_getaddr.c

index 37ce66c5f2e8f916682f4a0c76536b6c3f31433c..61ea283a3a54f411834c071b82bc1f21f1c39987 100644 (file)
@@ -204,11 +204,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);