From b8363ffff9c6015bc818ac6cc08d4efd503e5d5e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 5 Jun 2024 13:59:39 +1000 Subject: [PATCH] Add missing period to generated IPv4 6to4 name The period between the most significant nibble of the IPv4 address and the 2.0.0.2.IP6.ARPA suffix was missing resulting in the wrong name being checked. (cherry picked from commit bca63437a15d857cdf79ca1f1bbcb5e5062e5fb8) --- lib/dns/ssu.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/dns/ssu.c b/lib/dns/ssu.c index 581cdcd82f..396ca57477 100644 --- a/lib/dns/ssu.c +++ b/lib/dns/ssu.c @@ -246,13 +246,12 @@ stf_from_address(dns_name_t *stfself, const isc_netaddr_t *tcpaddr) { switch (tcpaddr->family) { case AF_INET: l = ntohl(tcpaddr->type.in.s_addr); - result = snprintf(buf, sizeof(buf), - "%lx.%lx.%lx.%lx.%lx.%lx.%lx.%lx" - "2.0.0.2.IP6.ARPA.", - l & 0xf, (l >> 4) & 0xf, (l >> 8) & 0xf, - (l >> 12) & 0xf, (l >> 16) & 0xf, - (l >> 20) & 0xf, (l >> 24) & 0xf, - (l >> 28) & 0xf); + result = snprintf( + buf, sizeof(buf), + "%lx.%lx.%lx.%lx.%lx.%lx.%lx.%lx.2.0.0.2.IP6.ARPA.", + l & 0xf, (l >> 4) & 0xf, (l >> 8) & 0xf, + (l >> 12) & 0xf, (l >> 16) & 0xf, (l >> 20) & 0xf, + (l >> 24) & 0xf, (l >> 28) & 0xf); RUNTIME_CHECK(result < sizeof(buf)); break; case AF_INET6: