diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-10-13 01:25:42 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-10-13 01:25:42 +0000 |
commit | 9dc72de41fac6b86c7d5cbcef862c9526437d5e9 (patch) | |
tree | 29958352fd534bd91606a07c4dbb1d8e69000be3 /src/or | |
parent | 9c49947163815cb5abb9f94a520e0323719ca0c5 (diff) | |
download | tor-9dc72de41fac6b86c7d5cbcef862c9526437d5e9.tar tor-9dc72de41fac6b86c7d5cbcef862c9526437d5e9.tar.gz |
Omit any exit rules that follow a catch-all rule when writing a router descriptor.
svn:r2459
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/router.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/router.c b/src/or/router.c index ba25292c9..aec642638 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -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; |