diff options
| author | David Härdeman | 2025-12-09 08:21:11 +0000 |
|---|---|---|
| committer | Álvaro Fernández Rojas | 2025-12-09 14:07:53 +0000 |
| commit | 00f2d7a4dbe5351f74e77cb3636897dc20ecb30b (patch) | |
| tree | 3939f3b069deb527faba9ffb525350f935d2e626 | |
| parent | c86d29bb83d6e89b4ffe49fa4155c3e1746b6b8e (diff) | |
| download | odhcpd-00f2d7a4dbe5351f74e77cb3636897dc20ecb30b.tar.gz | |
dhcpv4: don't send zero IPv6-only preferred option
As noted in https://github.com/openwrt/openwrt/issues/21048, if the
ipv6_only_preferred option isn't set (or is set to zero), odhcpd will
still include the IPv6-Only Preferred option (with a zero value) in
DHCPv4 replies, while it should not return the option at all.
Closes: https://github.com/openwrt/openwrt/issues/21048
Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/odhcpd/pull/341
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
| -rw-r--r-- | src/dhcpv4.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dhcpv4.c b/src/dhcpv4.c index 5073d97..31ef1e5 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -1306,7 +1306,8 @@ void dhcpv4_handle_msg(void *src_addr, void *data, size_t len, break; case DHCPV4_OPT_IPV6_ONLY_PREFERRED: - iov[IOV_IPV6_ONLY_PREF].iov_len = sizeof(reply_ipv6_only); + if (iface->dhcpv4_v6only_wait) + iov[IOV_IPV6_ONLY_PREF].iov_len = sizeof(reply_ipv6_only); break; case DHCPV4_OPT_CAPTIVE_PORTAL: |