<feed xmlns='http://www.w3.org/2005/Atom'>
<title>odhcpd/src/config.c, branch master</title>
<subtitle>OpenWrt DHCP Server</subtitle>
<id>https://git-03.infra.openwrt.org/project/odhcpd/atom?h=master</id>
<link rel='self' href='https://git-03.infra.openwrt.org/project/odhcpd/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/'/>
<updated>2025-12-18T17:05:47Z</updated>
<entry>
<title>all: remove dead code</title>
<updated>2025-12-18T17:05:47Z</updated>
<author>
<name>Paul Donald</name>
</author>
<published>2025-12-18T03:58:07Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=6152cf5dab4957944885254f01d9ebb95fab17ac'/>
<id>urn:sha1:6152cf5dab4957944885254f01d9ebb95fab17ac</id>
<content type='text'>
follow-up to 4df45c8c37227b67319ca39ee4eb2d21966ee693

These are not used anywhere

Signed-off-by: Paul Donald &lt;newtwen+github@gmail.com&gt;
Link: https://github.com/openwrt/odhcpd/pull/361
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>config: add default value for dhcpv6_pd_min_len</title>
<updated>2025-12-14T19:35:08Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2025-12-14T12:17:06Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=35f0e05a16a0e7540db32ca4ceea5d80f9e2a82a'/>
<id>urn:sha1:35f0e05a16a0e7540db32ca4ceea5d80f9e2a82a</id>
<content type='text'>
Right now, dhcpv6_pd_min_len is zero, meaning any request would be
accepted (as long as it fits what we have available).

That means that with a /56 (a common residential scenario), a downstream
router can request a /57 and gobble up 1/2 of the available address
space. Even a default dhcpv6_pd_min_len value of 60 means that we'd
support 15 PDs in total.

So let's err on the side of caution and set /62 as the default, people
who want larger allocations can easily override the default.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Link: https://github.com/openwrt/odhcpd/pull/357
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>config: allow minimum PD len up to 64</title>
<updated>2025-12-14T19:34:45Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2025-12-14T12:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=62113d007a6a18668cdcbb52811a1b79630f5848'/>
<id>urn:sha1:62113d007a6a18668cdcbb52811a1b79630f5848</id>
<content type='text'>
The current limit of [1,62] doesn't really seem to be justified. With
things like RFC9762 (DHCPv6-PD preferred), it isn't unlikely that we'll
see more DHCPv6-PD requests in the future, and not just from actual
routers.

The smallest realistic PD that can be allocated is a /64, so make that
the minimum.

Also, fix a bug in the logic (note that the PD_MIN_LEN_MAX actually
isn't enforced).

Closes: #352

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Link: https://github.com/openwrt/odhcpd/pull/357
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>statefiles: fix stale pio handling for !ubus</title>
<updated>2025-12-09T15:38:32Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2025-11-30T22:13:39Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=5203ad13954c28377fc4f0ffb7bfd2cf501303bb'/>
<id>urn:sha1:5203ad13954c28377fc4f0ffb7bfd2cf501303bb</id>
<content type='text'>
Currently, config.c:odhcpd_reload() will call:
	set_config()
		// the piodir is set here
	set_interface()
		config_parse_interface()
			statefiles_read_prefix_information()
	statefiles_setup_dirfd()
	ubus_apply_network()
		config_parse_interface()
			statefiles_read_prefix_information()

This works when ubus is enabled, because of the extra call to
ubus_apply_network() which will read the pio file after the
dirfd has been set up.

However, it won't work when ubus isn't enabled since it'll
turn ubus_apply_network() into a noop.

Fix this by moving the statefiles_setup_dirfd() calls into
set_config(), i.e. setup the dirfds as soon as the relevant
cfg options have been read.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Link: https://github.com/openwrt/odhcpd/pull/333
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>odhcpd: rename piofolder to piodir</title>
<updated>2025-12-09T15:38:25Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2025-11-30T20:59:33Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=a64760b30f67eee8f64d3a06790216de5e49b038'/>
<id>urn:sha1:a64760b30f67eee8f64d3a06790216de5e49b038</id>
<content type='text'>
A "folder" is a Windows concept, rename the cfg option from "piofolder"
to "piodir", which will also make it more consistent with other cfg
options.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Link: https://github.com/openwrt/odhcpd/pull/333
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>statefiles: rename prefix information functions</title>
<updated>2025-12-09T15:33:50Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2025-11-28T11:07:04Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=9f8abcc662d04208ab8880e61c789f824a5fac5e'/>
<id>urn:sha1:9f8abcc662d04208ab8880e61c789f824a5fac5e</id>
<content type='text'>
This makes it clearer that the functions are in statefiles.c.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Link: https://github.com/openwrt/odhcpd/pull/333
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>config: move pio json handling to statefiles.c</title>
<updated>2025-12-09T15:29:12Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2025-11-28T10:48:59Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=cb65b83e524e385265de3478c70e1c20b210263f'/>
<id>urn:sha1:cb65b83e524e385265de3478c70e1c20b210263f</id>
<content type='text'>
The prefix information files are also examples of statefiles, and there
are some things which can be shared between e.g. the state file logic
and the pio file logic (like the conversion from MONOTIME to time_t and
back, and also the use of tmp files). That's for later patches though,
this just moves the code without any code changes to make subsequent
patches clearer.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Link: https://github.com/openwrt/odhcpd/pull/333
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>statefiles: add a dirfd helper function</title>
<updated>2025-12-09T15:29:08Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2025-11-28T10:35:49Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=5b01849cc42cb410fc4ce152519a27fb93d9bcb6'/>
<id>urn:sha1:5b01849cc42cb410fc4ce152519a27fb93d9bcb6</id>
<content type='text'>
The same logic was repeated three times in config.c, move it
to a single function in statefiles.c.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Link: https://github.com/openwrt/odhcpd/pull/333
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>odhcpd: remove OAF_BROKEN_HOSTNAME</title>
<updated>2025-11-30T16:00:14Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2025-11-23T23:05:33Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=e568bde96e9f15bbd8fe571ad719ccb0491da34d'/>
<id>urn:sha1:e568bde96e9f15bbd8fe571ad719ccb0491da34d</id>
<content type='text'>
A bool is quite a bit more ergonomic (as the diff for this commit
shows).

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Link: https://github.com/openwrt/odhcpd/pull/331
Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
<entry>
<title>src: fix shadowed local variables</title>
<updated>2025-11-28T07:32:10Z</updated>
<author>
<name>Álvaro Fernández Rojas</name>
</author>
<published>2025-11-28T07:32:10Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/project/odhcpd/commit/?id=a170d63874f279d4bf48995a19285d7c7e7ad361'/>
<id>urn:sha1:a170d63874f279d4bf48995a19285d7c7e7ad361</id>
<content type='text'>
Fix shadowed local variables and enable warning to prevent more shadowed
variables in the future.

Signed-off-by: Álvaro Fernández Rojas &lt;noltari@gmail.com&gt;
</content>
</entry>
</feed>
