mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
Omit any exit rules that follow a catch-all rule when writing a router descriptor.
svn:r2459
This commit is contained in:
parent
9c49947163
commit
9dc72de41f
@ -709,7 +709,7 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
|
||||
return -1;
|
||||
written += result;
|
||||
}
|
||||
if (tmpe->prt_min == 0 && tmpe->prt_max == 65535) {
|
||||
if (tmpe->prt_min <= 1 && tmpe->prt_max == 65535) {
|
||||
/* There is no port set; write ":*" */
|
||||
if (written > maxlen-4)
|
||||
return -1;
|
||||
@ -729,6 +729,9 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
|
||||
return -1;
|
||||
written += result;
|
||||
}
|
||||
if (tmpe->msk == 0 && tmpe->prt_min <= 1 && tmpe->prt_max == 65535)
|
||||
/* This was a catch-all rule, so future rules are irrelevant. */
|
||||
break;
|
||||
} /* end for */
|
||||
if (written > maxlen-256) /* Not enough room for signature. */
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user