diff options
Diffstat (limited to 'src/or/router.c')
-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; |