diff --git a/src/or/main.c b/src/or/main.c index 720be45fe1..0bb241a9de 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -661,10 +661,9 @@ int dump_router_to_string(char *s, int maxlen, routerinfo_t *router) { signing_pkey_tag = "signing-key\n"; } - result = snprintf(s, maxlen, "router %s %d %d %d %d %d\n%s%s%s", + result = snprintf(s, maxlen, "router %s %d %d %d %d\n%s%s%s", router->address, router->or_port, - router->op_port, router->ap_port, router->dir_port, router->bandwidth, diff --git a/src/or/or.h b/src/or/or.h index 77477497a6..9a8bb36276 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -362,7 +362,6 @@ typedef struct { uint32_t addr; /* all host order */ uint16_t or_port; - uint16_t op_port; uint16_t ap_port; uint16_t dir_port; diff --git a/src/or/routers.c b/src/or/routers.c index c6e4d1012f..ada7ee66ce 100644 --- a/src/or/routers.c +++ b/src/or/routers.c @@ -742,7 +742,7 @@ static routerinfo_t *router_get_entry_from_string_tok(char**s, directory_token_t thank me for this someday. */ router->pkey = router->signing_pkey = NULL; - if (tok->val.cmd.n_args != 6) { + if (tok->val.cmd.n_args != 5) { log(LOG_ERR,"router_get_entry_from_string(): Wrong # of arguments to \"router\""); goto err; } @@ -759,23 +759,20 @@ static routerinfo_t *router_get_entry_from_string_tok(char**s, directory_token_t goto err; } - /* Router->op_port */ - router->op_port = atoi(ARGS[2]); - /* Router->ap_port */ - router->ap_port = atoi(ARGS[3]); + router->ap_port = atoi(ARGS[2]); /* Router->dir_port */ - router->dir_port = atoi(ARGS[4]); + router->dir_port = atoi(ARGS[3]); /* Router->bandwidth */ - router->bandwidth = atoi(ARGS[5]); + router->bandwidth = atoi(ARGS[4]); if (!router->bandwidth) { log(LOG_ERR,"router_get_entry_from_string(): bandwidth unreadable or 0. Failing."); } - log(LOG_DEBUG,"or_port %d, op_port %d, ap_port %d, dir_port %d, bandwidth %d.", - router->or_port, router->op_port, router->ap_port, router->dir_port, router->bandwidth); + log(LOG_DEBUG,"or_port %d, ap_port %d, dir_port %d, bandwidth %d.", + router->or_port, router->ap_port, router->dir_port, router->bandwidth); NEXT_TOKEN(); if (tok->tp != _PUBLIC_KEY) { diff --git a/src/or/test.c b/src/or/test.c index 547f73a079..741bb767a9 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -509,7 +509,6 @@ test_dir_format() r1.address = "testaddr1.foo.bar"; r1.addr = 0xc0a80001u; /* 192.168.0.1 */ r1.or_port = 9000; - r1.op_port = 9001; r1.ap_port = 9002; r1.dir_port = 9003; r1.pkey = pk1; @@ -529,7 +528,6 @@ test_dir_format() r2.address = "tor.tor.tor"; r2.addr = 0x0a030201u; /* 10.3.2.1 */ r2.or_port = 9005; - r2.op_port = 0; r2.ap_port = 0; r2.dir_port = 0; r2.pkey = pk2; @@ -554,7 +552,6 @@ test_dir_format() test_assert(rp1); test_streq(rp1->address, r1.address); test_eq(rp1->or_port, r1.or_port); - test_eq(rp1->op_port, r1.op_port); test_eq(rp1->ap_port, r1.ap_port); test_eq(rp1->dir_port, r1.dir_port); test_eq(rp1->bandwidth, r1.bandwidth); @@ -575,7 +572,6 @@ test_dir_format() test_assert(rp2); test_streq(rp2->address, r2.address); test_eq(rp2->or_port, r2.or_port); - test_eq(rp2->op_port, r2.op_port); test_eq(rp2->ap_port, r2.ap_port); test_eq(rp2->dir_port, r2.dir_port); test_eq(rp2->bandwidth, r2.bandwidth);