Skip to content

[25.12] backport fixes/updates from master#148

Merged
openwrt-bot merged 9 commits intoopenwrt:openwrt-25.12from
Noltari:openwrt-25.12-next
Dec 29, 2025
Merged

[25.12] backport fixes/updates from master#148
openwrt-bot merged 9 commits intoopenwrt:openwrt-25.12from
Noltari:openwrt-25.12-next

Conversation

@Noltari
Copy link
Member

@Noltari Noltari commented Dec 28, 2025

  • ra: convert if block to switch
  • odhcp6c: do cleanup at exit
  • config: fix potential memory leaks in error paths
  • all: add log helpers
  • dhcpv6: clarifying comments
  • dhcpv6: offload FQDN construction to init_dhcpv6
  • dhcpv6: migrate dhcpv6_response_is_valid to switch case

Draft until #147 is merged.

improve readability and performance

(cherry picked from commit 48dbd38)
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: openwrt#143
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Improve performance by doing this only once at init, instead
of every time at dhcpv6_send.

We also add a length check for dn_comp which can return -1.

(cherry picked from commit 65f9ee2)
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: openwrt#143
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Add comments to make it easier to follow the code.

(cherry picked from commit 0bb93c2)
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: openwrt#143
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
avoids multiple syslog.h include

(sync with implementation in odhcpd)

We deprecate the `-v` param. Add new `-l` param for level,
identical to odhcpd.

The odhcp6c `dhcpv6.sh` script in openwrt main should be updated
to recognize this change, but it is harmless if it is not changed.

(cherry picked from commit bfd7597)
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: openwrt#142
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
In the parsing helpers we do:

`*dst = realloc(*dst, ...); if (!*dst) return -1;`

If a later realloc call failed, the previous buffer
pointer was overwritten with NULL, so the already
allocated block is lost.

We're probably already in a dire situation if we cannot
allocate more memory, so the fix is a principled one.

The caller `config_parse_opt()` does `free(payload)`.

(cherry picked from commit 610e4bd)
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: openwrt#145
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
cleanup frees all state buffers, releases any auth token,
and closes the random FD to avoid lingering allocations
after exit.

(cherry picked from commit 2e6682b)
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: openwrt#145
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Improve readability and accelerate jumps.

(cherry picked from commit 5e1ab3b)
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: openwrt#146
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
@Noltari Noltari self-assigned this Dec 28, 2025
@systemcrash
Copy link
Contributor

Self reminder that the log fixes benefit from the dhcpv6.sh tweaks in #142

Properly align code with tabs instead of whitespaces.

(cherry picked from commit 988d5fb)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Omit IA_NA on Request if not present on Solicit, which is against RFC7550,
but turns out some broken ISPs don't like this.
See openwrt#144

(cherry picked from commit 8abb450)
Closes: openwrt#144
Link: openwrt#147
Fixes: 63461f6 ("dhcpv6: always include IA_NA and IA_PD in Request message if requested")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
@Noltari Noltari marked this pull request as ready for review December 29, 2025 16:35
@openwrt-bot openwrt-bot merged commit 699cc61 into openwrt:openwrt-25.12 Dec 29, 2025
9 checks passed
@Noltari Noltari deleted the openwrt-25.12-next branch December 29, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants