<div dir="ltr"><div>Hello everyone,</div><div>Is there any chance this patch could be merged?</div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Nov 19, 2025 at 1:47 AM Geert Stappers <<a href="mailto:stappers@stappers.nl">stappers@stappers.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Oct 07, 2025 at 07:18:27PM +0200, Petr Menšík via Dnsmasq-discuss wrote:<br>
> Hello Simon and everyone,<br>
> <br>
> I am sending this patch on behalf of Tomáš Korbař, who worked on<br>
> debugging the issue and even written a test [1] to verify it works. Test<br>
> is written in our shell based beakerlib, but I think is readable enough<br>
> even in basic form.<br>
<br>
I'm sending this reminder.<br>
Because there was no-follow-up yet.<br>
<br>
<br>
> Currentdhcp-range does not work well in case DHCP client would refuse the<br>
> offered address. When this happens, current dnsmasq does not even stop at<br>
> maximal address specified. This change adds similar check like when no<br>
> dhcp-sequential-ip is used. Tomáš tested it already, but would anyone mind<br>
> testing it also? If there is no regression or need to adjust it, would you<br>
> mind merging it? Thank you in advance! Cheers, Petr<br>
> 1. <a href="https://gitlab.com/redhat/centos-stream/tests/dnsmasq/-/merge_requests/6" rel="noreferrer" target="_blank">https://gitlab.com/redhat/centos-stream/tests/dnsmasq/-/merge_requests/6</a><br>
> <br>
> -- <br>
> Petr Menšík<br>
> Senior Software Engieer, RHEL<br>
> Red Hat, <a href="https://www.redhat.com/" rel="noreferrer" target="_blank">https://www.redhat.com/</a><br>
> PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB<br>
<br>
> From 913472864bdcd5b7bb01c31ff27706b6dfbb99a2 Mon Sep 17 00:00:00 2001<br>
> From: Tomas Korbar <<a href="mailto:tkorbar@redhat.com" target="_blank">tkorbar@redhat.com</a>><br>
> Date: Tue, 7 Oct 2025 19:12:00 +0200<br>
> Subject: [PATCH] Fix obeying dhcp-range if dhcp-sequential-ip and IPV6 is used<br>
> <br>
> Previously starting position for searching the next free address<br>
> in IPV6 range was no checked whether it is in bounds. This<br>
> commit adds modulo operation like when dhcp-sequential-ip is<br>
> not used to ensure dnsmasq does not offer out of range address.<br>
> ---<br>
> src/dhcp6.c | 17 ++++++++---------<br>
> 1 file changed, 8 insertions(+), 9 deletions(-)<br>
> <br>
> diff --git a/src/dhcp6.c b/src/dhcp6.c<br>
> index 482caf7d..99cc77b2 100644<br>
> --- a/src/dhcp6.c<br>
> +++ b/src/dhcp6.c<br>
> @@ -522,27 +522,26 @@ struct dhcp_context *address6_allocate(struct dhcp_context *context, unsigned c<br>
> continue;<br>
> else<br>
> { <br>
> + u64 range = 1 + addr6part(&c->end6) - addr6part(&c->start6);<br>
> + u64 offset = c->addr_epoch;<br>
> if (!temp_addr && option_bool(OPT_CONSEC_ADDR))<br>
> {<br>
> /* seed is largest extant lease addr in this context,<br>
> skip addresses equal to the number of addresses rejected<br>
> by clients. This should avoid the same client being offered the same<br>
> address after it has rjected it. */<br>
> - start = lease_find_max_addr6(c) + 1 + serial + c->addr_epoch;<br>
> + offset += lease_find_max_addr6(c) - addr6part(&c->start6) + 1 + serial;<br>
> if (c->addr_epoch)<br>
> c->addr_epoch--;<br>
> }<br>
> else<br>
> {<br>
> - u64 range = 1 + addr6part(&c->end6) - addr6part(&c->start6);<br>
> - u64 offset = j + c->addr_epoch;<br>
> -<br>
> - /* don't divide by zero if range is whole 2^64 */<br>
> - if (range != 0)<br>
> - offset = offset % range;<br>
> -<br>
> - start = addr6part(&c->start6) + offset;<br>
> + offset += j;<br>
> }<br>
> + /* don't divide by zero if range is whole 2^64 */<br>
> + if (range != 0)<br>
> + offset = offset % range;<br>
> + start = addr6part(&c->start6) + offset;<br>
> <br>
> /* iterate until we find a free address. */<br>
> addr = start;<br>
> -- <br>
> 2.51.0<br>
> <br>
<br>
Groeten<br>
Geert Stappers<br>
Picking up some patches<br>
-- <br>
Silence is hard to parse<br>
<br>
_______________________________________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk" target="_blank">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
<a href="https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss</a><br>
</blockquote></div>