From: W.C.A. Wijngaards Date: Thu, 6 Aug 2026 07:08:17 +0000 (+0200) Subject: - Fix ##1485: the list_forwards command omits port numbers. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7d13ff12b673d31066e1ced0b0f59a202adc3ad;p=thirdparty%2Funbound.git - Fix ##1485: the list_forwards command omits port numbers. The list_forwards and list_stubs commands for unbound-control print port and tls auth name. --- diff --git a/daemon/remote.c b/daemon/remote.c index 8e6ba19b1..6931a78f7 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -2681,7 +2681,7 @@ static int ssl_print_name_dp(RES* ssl, const char* str, uint8_t* nm, uint16_t dclass, struct delegpt* dp) { - char buf[LDNS_MAX_DOMAINLEN]; + char buf[LDNS_MAX_DOMAINLEN], portstr[128], tls_auth_name[256]; struct delegpt_ns* ns; struct delegpt_addr* a; int f = 0; @@ -2696,13 +2696,32 @@ ssl_print_name_dp(RES* ssl, const char* str, uint8_t* nm, uint16_t dclass, } for(ns = dp->nslist; ns; ns = ns->next) { dname_str(ns->name, buf); - if(!ssl_printf(ssl, "%s%s", (f?" ":""), buf)) + if(ns->port != UNBOUND_DNS_PORT) + snprintf(portstr, sizeof(portstr), "@%d", ns->port); + else portstr[0]=0; + if(ns->tls_auth_name) + snprintf(tls_auth_name, sizeof(tls_auth_name), "#%s", + ns->tls_auth_name); + else tls_auth_name[0]=0; + if(!ssl_printf(ssl, "%s%s%s%s", (f?" ":""), buf, portstr, + tls_auth_name)) return 0; f = 1; } for(a = dp->target_list; a; a = a->next_target) { + int port = (unsigned)((a->addr.ss_family == AF_INET) ? + ntohs(((struct sockaddr_in*)&a->addr)->sin_port) : + ntohs(((struct sockaddr_in6*)&a->addr)->sin6_port)); addr_to_str(&a->addr, a->addrlen, buf, sizeof(buf)); - if(!ssl_printf(ssl, "%s%s", (f?" ":""), buf)) + if(port != UNBOUND_DNS_PORT) + snprintf(portstr, sizeof(portstr), "@%d", port); + else portstr[0]=0; + if(a->tls_auth_name) + snprintf(tls_auth_name, sizeof(tls_auth_name), "#%s", + a->tls_auth_name); + else tls_auth_name[0]=0; + if(!ssl_printf(ssl, "%s%s%s%s", (f?" ":""), buf, portstr, + tls_auth_name)) return 0; f = 1; } diff --git a/doc/Changelog b/doc/Changelog index f29912256..f433ced7a 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,8 @@ +6 August 2026: Wouter + - Fix ##1485: the list_forwards command omits port numbers. + The list_forwards and list_stubs commands for + unbound-control print port and tls auth name. + 4 August 2026: Wouter - Fix to set makedist.sh to not wget config.sub and config.guess from git repo. The fetch times out, and the