Skip to content

Commit

Permalink
Merge branch 'tor-gitlab/mr/56'
Browse files Browse the repository at this point in the history
  • Loading branch information
dgoulet-tor committed Jul 16, 2020
2 parents e66eba6 + aa95611 commit b83c6ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/feature/nodelist/nodelist.c
Original file line number Diff line number Diff line change
Expand Up @@ -1988,6 +1988,12 @@ node_set_country(node_t *node)
else if (node->ri)
ipv4_addr = &node->ri->ipv4_addr;

/* IPv4 is mandatory for a relay so this should not happen unless we are
* attempting to set the country code on a node without a descriptor. */
if (BUG(!ipv4_addr)) {
node->country = -1;
return;
}
node->country = geoip_get_country_by_addr(ipv4_addr);
}

Expand Down

0 comments on commit b83c6ab

Please sign in to comment.