summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Fahlgren2026-03-11 14:10:27 +0000
committerÁlvaro Fernández Rojas2026-03-16 17:50:03 +0000
commit160e5fa3957cfd9d89f8ff7493f28a8baaf6ced7 (patch)
tree308e6df699c1db0e65143b90b389b7bca60b79c4
parent2a316dbfd798abf57b1b8ee5bc27de7e36ff1a25 (diff)
downloadodhcpd-master.tar.gz
odhcpd: ensure zero padding on DNSSLHEADmaster
From https://www.rfc-editor.org/rfc/rfc8106#section-5.2 regarding the DNSSL field: Because the size of this field MUST be a multiple of 8 octets, for the minimum multiple including the domain name representations, the remaining octets other than the encoding parts of the domain name representations MUST be padded with zeros. The current code leaves the trailing octets in uninitialized state, resulting in parsing errors on (at least) systemd RA clients. This commit restores the explicit zeroing of the trailing octets. Closes: https://github.com/openwrt/openwrt/issues/22351 Fixes: 0a54ce0d2b57 ("odhcpd: rename iface->search -> iface->dns_search") Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com> Link: https://github.com/openwrt/odhcpd/pull/386 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
-rw-r--r--src/router.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/router.c b/src/router.c
index 731a6dc..7bc2d8e 100644
--- a/src/router.c
+++ b/src/router.c
@@ -920,6 +920,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr
if (iface->ra_dns && iface->dns_search_len > 0) {
search_sz = sizeof(*search) + ((iface->dns_search_len + 7) & ~7);
search = alloca(search_sz);
+ memset(search, 0, search_sz);
*search = (struct nd_opt_search_list) {
.type = ND_OPT_DNS_SEARCH,
.len = search_sz / 8,