aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-03-01 12:22:57 -0500
committerNick Mathewson <nickm@torproject.org>2013-03-01 12:22:57 -0500
commitb528aaef035213dee93663599dc46b1898ae3f8e (patch)
treec772a7fbdce5fe1d856519b322cc1ebb2384d22f
parent5e0ce4c578127d6479604280430db3d40f125cd6 (diff)
downloadtor-b528aaef035213dee93663599dc46b1898ae3f8e.tar.gz
tor-b528aaef035213dee93663599dc46b1898ae3f8e.zip
Make sure that [::1] is recognized as a private address
Fixes bug 8377; bugfix on 0.2.1.3-alpha.
-rw-r--r--changes/bug83773
-rw-r--r--src/common/address.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/changes/bug8377 b/changes/bug8377
new file mode 100644
index 0000000000..c9ad151bc9
--- /dev/null
+++ b/changes/bug8377
@@ -0,0 +1,3 @@
+ o Minor bugfixes:
+ - Correctly recognize that [::1] is a loopback address. Fixes bug #8377;
+ bugfix on 0.2.1.3-alpha.
diff --git a/src/common/address.c b/src/common/address.c
index e88869f1d8..df26f61f8f 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -779,7 +779,8 @@ tor_addr_is_loopback(const tor_addr_t *addr)
case AF_INET6: {
/* ::1 */
uint32_t *a32 = tor_addr_to_in6_addr32(addr);
- return (a32[0] == 0) && (a32[1] == 0) && (a32[2] == 0) && (a32[3] == 1);
+ return (a32[0] == 0) && (a32[1] == 0) && (a32[2] == 0) &&
+ (ntohl(a32[3]) == 1);
}
case AF_INET:
/* 127.0.0.1 */