From 13e211de17768206f6822dd5a3a6bdf5fda2ded9 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sat, 2 Apr 2005 08:55:31 +0000 Subject: [PATCH] We're printing the host mask wrong in exit policies in server descriptors. I believe this isn't a critical bug tho, since we're still obeying the exit policy internally. svn:r3987 --- src/or/router.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/or/router.c b/src/or/router.c index 2e7aa5eff3..5c3b416245 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -861,8 +861,8 @@ int router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router, /* Write the exit policy to the end of 's'. */ for (tmpe=router->exit_policy; tmpe; tmpe=tmpe->next) { - in.s_addr = htonl(tmpe->addr); /* Write: "accept 1.2.3.4" */ + in.s_addr = htonl(tmpe->addr); tor_inet_ntoa(&in, addrbuf, sizeof(addrbuf)); result = tor_snprintf(s+written, maxlen-written, "%s %s", tmpe->policy_type == ADDR_POLICY_ACCEPT ? "accept" : "reject", @@ -872,8 +872,8 @@ int router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router, written += result; if (tmpe->msk != 0xFFFFFFFFu && tmpe->msk != 0) { /* Write "/255.255.0.0" */ - tor_inet_ntoa(&in, addrbuf, sizeof(addrbuf)); in.s_addr = htonl(tmpe->msk); + tor_inet_ntoa(&in, addrbuf, sizeof(addrbuf)); result = tor_snprintf(s+written, maxlen-written, "/%s", addrbuf); if (result<0) return -1;