From 4b7d224d17e5d11b4ea50a8dece763aaedf21d17 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 8 Jul 2010 10:56:28 -0500 Subject: [PATCH] Treat all 127.0/16 addresses as loopback 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 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/rx/rx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rx/rx.h b/src/rx/rx.h index 3e4621832..2961b8016 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -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); } /******************* -- 2.39.5