connectd: fix advertizing for Tor ports.

We were accidentally using the port that the tor service was
connecting to, not the /torport the user said to use.

Fixes: #4597
Reported-by: @openoms
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Config: `addr` autotor and statictor /torport arguments now advertized correctly.
This commit is contained in:
Rusty Russell
2021-06-16 15:15:55 +09:30
parent 41767560d6
commit 976a79094b
2 changed files with 4 additions and 1 deletions

View File

@@ -125,8 +125,11 @@ struct wireaddr_internal {
/* ADDR_INTERNAL_AUTOTOR
* ADDR_INTERNAL_STATICTOR */
struct torservice {
/* Where to connect to Tor proxy */
struct wireaddr address;
/* Tor port to use */
u16 port;
/* Blob to use to create tor service */
u8 blob[TOR_V3_BLOBLEN + 1];
} torservice;
/* ADDR_INTERNAL_FORPROXY */

View File

@@ -183,7 +183,7 @@ static struct wireaddr *make_fixed_onion(const tal_t *ctx,
name = tal_fmt(tmpctx, "%s.onion", line);
onion = tal(ctx, struct wireaddr);
if (!parse_wireaddr(name, onion, local->port, false, NULL))
if (!parse_wireaddr(name, onion, port, false, NULL))
status_failed(STATUS_FAIL_INTERNAL_ERROR,
"Tor gave bad onion name '%s'", name);
#ifdef SUPERVERBOSE