aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-04-01 21:10:14 -0400
committerNick Mathewson <nickm@torproject.org>2014-04-01 21:10:14 -0400
commit408bd98e79196933e447cbc68c73ecffebaf5a19 (patch)
treea5bdc4af3d10637081d639772b6dfef7078744e2 /src
parentdafed84dabbb3afbada5e55ac1d030412418fae5 (diff)
downloadtor-408bd98e79196933e447cbc68c73ecffebaf5a19.tar
tor-408bd98e79196933e447cbc68c73ecffebaf5a19.tar.gz
Add one more missing heck on bug4645 fixes
Diffstat (limited to 'src')
-rw-r--r--src/or/directory.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 6effe45db..d6d2339e9 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1415,9 +1415,8 @@ http_set_address_origin(const char *headers, connection_t *conn)
fwd = http_get_header(headers, "X-Forwarded-For: ");
if (fwd) {
tor_addr_t toraddr;
- tor_addr_parse(&toraddr,fwd);
-
- if (tor_addr_is_internal(&toraddr,0)) {
+ if (tor_addr_parse(&toraddr,fwd) == -1 ||
+ tor_addr_is_internal(&toraddr,0)) {
log_debug(LD_DIR, "Ignoring local/internal IP %s", escaped(fwd));
tor_free(fwd);
return;