aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/directory.c')
-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;