]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Treat all 127.0/16 addresses as loopback
authorAndrew Deason <adeason@sinenomine.net>
Thu, 8 Jul 2010 15:56:28 +0000 (10:56 -0500)
committerDerrick Brashear <shadow@dementia.org>
Wed, 14 Jul 2010 17:27:45 +0000 (10:27 -0700)
Many places treat loopback addresses specially; they are skipped over
when traversing local interface lists, and they are sometimes replaced
with the public IP of the local hostname when interpreting user
arguments.

However, we only treated 127.0.0.1 as 'loopback'. Many systems can
have more than one loopback interface, such as having an interface
with the address 127.0.0.2. So, to catch these, treat everything in
127.0/16 as a loopback address or otherwise 'invalid' address. We
still do not treat the rest of 127/8 like this, to still allow some
127.* addresses to not be treated as loopback if someone really wants
to.

Change-Id: I64724cc1ee366e5ef80a8d6e3008e30a7077a4b2
Reviewed-on: http://gerrit.openafs.org/2367
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
src/rx/rx.h

index 3e46218322ef3b5212f991323bab536297dbe6c7..2961b80169770a605b128118f8331aea3dbcbe47 100644 (file)
@@ -125,7 +125,7 @@ int ntoh_syserr_conv(int error);
 static_inline int
 rx_IsLoopbackAddr(afs_uint32 addr)
 {
-    return (addr == 0x7f000001);
+    return ((addr & 0xffff0000) == 0x7f000000);
 }
 
 /*******************