5568 Commits
Author SHA1 Message Date
David Härdeman ea42d87528 odhcpd: create /tmp/odhcpd in the init script
odhcpd creates its default lease directory /tmp/odhcpd/leases itself,
which only works while it runs as root.

Create /tmp/odhcpd in the init script, owned by root and with fixed
permissions, so that it only needs to be handed over to the odhcpd user
once odhcpd runs unprivileged (#24558).

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/27183
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-05 15:36:36 +01:00
David Härdeman 9b6ef8e510 odhcpd: don't preset the DHCPv4 pool in new configs
odhcpd determines the DHCPv4 pool itself if start and limit are unset
(openwrt/odhcpd#399), but new configs get start 100 and limit 150.
Leave them out; existing configs are unchanged.

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/27183
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-05 15:36:36 +01:00
David Härdeman 35e05433e3 odhcpd: replace leasefile and leasetrigger by leasedir
odhcpd no longer supports the leasetrigger and leasefile options
(openwrt/odhcpd#462): DNS servers watch the hosts directory or use the
dhcp.hosts.update ubus event, and the lease files are internal to
odhcpd, one per interface in leasedir.

Remove odhcpd-update, delete both options from existing configs and set
leasedir if it isn't set yet. It isn't derived from leasefile, as the
two hold different things.

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/27183
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-05 15:36:36 +01:00
David Härdeman 222531f499 odhcpd: drop the removed enable_tz option
odhcpd no longer supports enable_tz (openwrt/odhcpd#460, the time zone
options are sent if a time zone is set), but existing configs keep it.
Delete it on upgrade.

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/27183
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-05 15:36:36 +01:00
David Härdeman 3534c89d0b odhcpd: drop the removed dhcpv4_forcereconf option
odhcpd no longer supports dhcpv4_forcereconf (openwrt/odhcpd#452), but
existing configs keep it. Delete it from the dhcp sections on upgrade,
with a helper that also serves future option removals.

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/27183
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-05 15:36:36 +01:00
David Härdeman 864d9a01d1 odhcpd: drop the config migrations from before 25.12
odhcpd.defaults still migrates piofolder to piodir, hostsfile to
hostsdir, the old default lease file path and the legacy option. 25.12
already does all of that, and upgrades are only supported from the
previous release.

Drop these migrations.

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/27183
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-05 15:36:36 +01:00
David Härdeman d2a92b0caf odhcpd: update to Git HEAD (2026-12-05)
d9dd1aa8a754 dhcpv6: build DNR option once per reply
ed4867c089cb ubus: flag leases which are being reconfigured or removed
8a0f33d502e2 ubus: add methods to remove active leases
bed54ff17aa5 dhcpv6-reg: allow removing registrations
7105625b6086 dhcpv6-ia: allow removing active leases
d2cd50c5a9e3 dhcpv4: allow removing active leases
68a28359bb2e dhcpv4: build the captive-portal option once
abd3d6a8f7a4 config: reject the DHCPv4 relay and hybrid modes
908733e770df treewide: refer to RFC 9915 instead of RFC 8415
4e73eafdf60b dhcpv6: ignore all unicast messages from clients
ef683d1f287e config: announce hostname changes of static leases
dfbb111fdb99 dhcpv4: announce the end of leases odhcpd removes
ec9d7fe0f5c6 dhcpv4: only announce the end of bound leases
884ab771e3fc dhcpv4: don't drop a binding when its client discovers again
8b00bf4ae338 dhcpv6-ia: give a returning client its released address or prefix back
d5cb7803c024 dhcpv6-ia: announce the end of leases odhcpd removes
dc4fdc4a43cc dhcpv6-ia: don't drop a binding when its client solicits again
474c7e79c9e0 dhcpv6-ia: add ubus notifications for DHCPv6 leases
3b0dcf826fcd dhcpv6: report the addresses/prefixes actually given to the client
d81c530cac64 ubus: key the lease and prefix lists by interface
e92b949f41fd ubus: add the interface and device names to the DHCPv4 lease events
ecdbbf5e044a ubus: report the UCI section of static leases
4a867c7dd8cf statefiles: only write the files that changed
859abe03c122 config: replace the leasefile option by leasedir
da83e467bf3e config: remove the leasetrigger option
bcb92c5c8ea9 config: always log a log level change
8ed91e4c5dfb config: reset removed global options on reload
e4b10863efc0 config: remove the enable_tz option
d108076b7444 config: don't rewrite spaces in the time zone
32fe941526c5 dhcpv4: send the time zone options (RFC 4833)
70153b9174ca dhcpv6: don't send empty time zone options
23c24941b47d config: reload the time zone from scratch
e1eaf902c5d9 dhcpv6-ia: make clients renew when their static lease config changes
e4ac60711f46 dhcpv4: make clients renew when their static lease config changes
a6d98f340889 ndp: keep the relay sockets if the interface is unchanged
13e4bacdb664 dhcpv4: keep the socket if the interface is unchanged
4367fee3cec6 dhcpv6: run the rest of the setup when the socket is kept
50b4cb4fbad6 dhcpv6: keep the socket if the interface is unchanged
7f387e247bab dhcpv4: keep the leases while the interface is down
da76b5e972a5 dhcpv4: send a new FORCERENEW nonce after INIT-REBOOT
3cbdb5d2a250 dhcpv4: don't assume a server address change for FORCERENEW

Change: https://github.com/openwrt/odhcpd/compare/bbba3f7c9cc8...d9dd1aa8a754
Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/27183
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-05 15:36:36 +01:00
Julius Bairaktaris 0b8b834019 qca-ppe-qos: skip the Wi-Fi small-packet filters for frames already stamped
The driver gives a frame it hands to a Wi-Fi netdev from the PPE path the
small-packet priority itself, so a short frame has skb->priority 256 +
small_pkt_prio when the egress classifier of the netdev sees it. The four
u32 filters still run on every such frame, a PSH test and a length test
per address family, and each filter is a separate call in the egress
chain.

Put a first filter in front of them that passes a frame whose priority is
above 255, so a stamped frame takes one filter and the rest only see
frames that came by the host or that the driver's rule left alone. Frames
above 255 now also skip any filter a user put at a higher preference on
the same egress.

The length test was the high byte of the length field being zero, which is
a threshold of 255 whatever small_pkt_len is set to, while the driver
stamps a frame whose L3 length is at most small_pkt_len. u32 cannot
compare, so the length is a compare ematch: the IPv4 total length is at
most small_pkt_len, the IPv6 payload length at most small_pkt_len - 40,
which is the driver's count of 40 bytes of header. That needs
kmod-sched for the meta and cmp ematches.

Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/26732
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-05 13:31:29 +01:00
Josef Schlehofer 4f52292e57 iproute2: drop the macOS netem patch
The patch adapts the netem distribution table generators for macOS and
FreeBSD. OpenWrt never builds them, because
130-no_netem_tipc_man_vdpa.patch drops netem from SUBDIRS. The package
does not change, so PKG_RELEASE stays.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/27205
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-05 13:02:21 +01:00
Felix Fietkau 901ea3e6fc unetd: cli: add commands to upgrade a network to PQC
An existing network has no PQC keys, and its hosts have no way to get
them into the network data without manual key handling on every host.

Add 'pqc-enable', which adds a sntrup761 secret key to the local host of
a network, and the edit command 'pqc-import', which adds the public key
of the local host and the keys that connected peers announced to the
network data. Links keep working without a PSK until the first PQC
handshake. 'pqc-enable' does not replace an existing key without force,
because the PQC links of the host stay down until the new key is
imported. Also show the PQC state of each peer and a local key error in
'status'.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-12-03 20:23:12 +01:00
Felix Fietkau 809f49b285 unetd: cli: use PQC keys for new networks and hosts
A network created or joined through the CLI has no PQC keys, so its
links never use the post-quantum PSK exchange.

Generate a sntrup761 key for the local host on create and join, unless
pqc is set to 0, and put the public key of an invited host into the
network data when the joining host sent one. A host that joins through
an inviter without PQC support keeps its secret key, so that its public
key can be added later. Also allow the pqc-key of a host to be edited.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-12-03 20:23:12 +01:00
Felix Fietkau 99a523c3fa unetd: pass the PQC secret key to unetd
Add the pqc_key option of a unet interface, which holds the sntrup761
secret key of the host for the post-quantum PSK exchange.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-12-03 20:23:12 +01:00
Felix Fietkau 9493b4aff5 unetd: update to Git HEAD (2026-12-03)
0242b8f3dcae token: fix out-of-bounds read on malformed token input
df1061deae7f stun: zero attribute table before parsing
5bf72f297a2a wg-linux: fix off-by-one in device netlink attribute parse
e46a13de63b7 network: free STUN state before clearing net_config on reload
79db60b61407 host: guard against missing local_host in route check
0df027c3da89 ubus: use a dedicated buffer for the network address list
6c6defc7b125 pex-msg: check allocation in update response handler
8de5cc40bbe8 udht: bail out on socketpair failure
b78ff1cdbae5 cli: reject over-long password before copy
7a2a41cfa5a4 host: clear local_host reference when freeing hosts
80effff35584 host: fix uninitialised meta pointer for dynamic peers
9d58d9549a30 network: fix subnet match in endpoint route check
77e6c43befe0 utils: fix IPv6 UDP checksum calculation
a9a573dfe4ed host: apply direct/indirect peer transitions on reload
bc68bfc42456 wg: advance peer idle accounting once per refresh
1441a76fefb2 wg: ignore the first rx byte counter sample
8be8b29c7209 ubus: fix token buffer leak in token_create
dbb6fc5c8e11 vxlan: set IFLA_MTU outside of the IFLA_LINKINFO nest
7015ec659bf7 bpf: fix off-by-one in skb_ptr() bounds check
43bb934c6c60 udht: keep ubus registrations across ubusd restarts
b457bac85d49 udht: do not flush networks on a failed ubus query
a93ccda5dc94 pex: fix gateway check for dynamic peers in query handler
cc717b23f054 stun: fix FILE handle leak on read failure
def9f6e4c3df pex: read update request version after length check
a836d9c887a4 network: check fork() result before waitpid()
1985dd2daf7e network: remove temporary file when saving dynamic data fails
3687ac07617b main: do not install a truncated hosts file
0c7e7d7ffe99 bpf: report mssfix attach failures
44021f939c10 wg-linux: propagate intermediate netlink request errors
d8b5f4ce138e wg-linux: validate attribute lengths when parsing peers
c6798c2842a2 wg-linux: fix copy-pasted ops name
977ce767d369 cli: harden file loading in sign and verify commands
4f61fe928fbb utils: reject subnet strings with an empty mask
85fb8c0b27cf vxlan: fix cur_forward_ports leak on tunnel free
e326ab380b80 vxlan: fix ifname length check in tunnel lookup
f674ebf5b564 vxlan: handle tunnel creation and renames on service reload
c7b385364fbe rtnl: handle missing socket and failed message allocation
c5f2d01d3286 pex: align message payload structures in packet buffers
20c52de9751b udht: avoid unaligned loads when parsing DHT values
6a747c4dc7d1 enroll: realign message payload before parsing
4c98b9a556f2 udht: drop DHT values without a matching network
89122f7abff6 udht: require the unix socket path option
19cb14428a99 udht: preserve command-line networks across disconnects
d7f501b60f58 udht: match receive buffer to forwarded datagram size
88dd8393a125 bpf: scan the full TCP option space for the MSS option
236fc7666993 treewide: check allocations before use
fa03a5e9c849 udht: fix FILE handle leak when loading nodes
daf184ca706a token: reject tokens from dynamic peers
938be72344ac host: accept non-string values in host meta tables
d2bed8487c46 pex-msg: clear urandom handle on failed open
8f7a11efa076 pex-msg: validate length of forwarded unix datagrams
9493560be374 enroll: clean up state when urandom cannot be opened
f6065a8a30ec udht: handle failed socket handover to unetd
95132c173a9c main: report failure to open the global PEX socket
8fc418895229 treewide: check remaining calloc_a allocations
419dff2945d5 pex: keep interface hosts when the netifd query fails
a45cf254d037 pex: do not orphan retained hosts when closing the socket
2142ca97dc53 host: keep the connect timer running without keepalive
5167dbb1b210 ubus: open firewall for the ports actually in use
e1b5f5036704 pex-msg: unlink request context on init failure
7377e79754f7 cli: detect output write failures
e6653e86532c network: detect flush errors when saving dynamic data
c0ab6efc2f2c pex-msg: do not drop packets when unix socket forwarding fails
f4b83ba82f0f pex-msg: fix response data leak on failed continuation init
9348469045fa pex: do not send peer messages without an open local PEX socket
daa04def5a0b enroll: apply replay protection to accept and confirm messages
8553e53c4884 enroll: do not update peer state from unauthenticated messages
c3b6bfd2cdd9 enroll: verify the confirmation hash in client accept messages
b62a3f270250 vxlan: handle missing local host in tunnel setup
e113c20e6597 enroll: make the attribute table static
2dd6d2156f6c network: cap dynamic data size when loading from disk
7c3213d00225 network: keep in-memory network data when reloading from disk fails
8c05265d07cc pex-msg: open the raw send sockets with IPPROTO_RAW
5284620e082d chacha20.h: add missing includes
3098578a9506 lib: add utility function for getting random data
4f67f3286e17 lib: add sntrup761 code
8a7f17b27d5e sntrup761: add function for deriving public key from secret key
54a2ce7cfe8e cli: add support for generating pq host keys
5ac0f55cb3b7 pex-pqc: add sntrup761-based post-quantum WireGuard PSK exchange
7b9e57468fc7 enroll: transfer a PQC public key from the joining host
a31b42a501b6 pex: announce the local PQC key and report the PQC state
eee829968dfd PEX.md: document the enroll and PQC messages
d8d6148c2692 network: wipe the network secrets before freeing the config

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-12-03 20:23:12 +01:00
Felix Fietkau c783bec5f4 netifd: update to Git HEAD (2026-11-23)
49181a38ee29 system-linux: take over a bridge that exists when netifd adds it
d41ad322974d bridge: restart the bridge when another process deletes it
43fd43b423c2 bridge: sync the vlans of a configured port on its hotplug del
c372d0aaab3c device: ignore a uevent add of a link that is not listed yet
bd6f4d48123b device: remove the hotplug members of a master before freeing it

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-12-03 20:23:12 +01:00
Marek Lindner c0ed13f6e0 wifi-scripts: fix WPA Enterprise / PPSK FT_KEY_CANT_BE_DERIVED error
The RADIUS secret is now stored in config.auth_server_shared_secret (via
alias) instead of config.auth_secret. But the code checks the existence of
config.auth_secret when ieee80211r is enabled to derive necessary keys.

Fixes: 218f3884d2 ("wifi-scripts: add ucode based scripts")
Signed-off-by: Marek Lindner <marek.lindner@mailbox.org>
Signed-off-by: Sven Eckelmann <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/26057
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-03 12:36:51 +01:00
Andy Chiang e989c8100d dnsmasq: refresh patches
Commit cdc3827a7b ("dnsmasq: cherrypick upstream to fix CVEs/vulns
(2)") added 002-Fix-information-disclosure.patch and
003-Fix-information-disclosure2.patch, which modify src/forward.c.
As a result, 200-ubus_dns.patch applies with an offset of 17 lines.
Refresh the patch to remove the offset.

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/27111
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-12-03 11:56:28 +01:00
Josef Schlehofer 94a082c6ab libiwinfo: update to Git HEAD (2026-11-28)
6f500bc1fa0d devices: add device for NETGEAR Nighthawk A9000 Wi-Fi 7
3d035140ec93 devices: add device id for MediaTek MT7925E
b512eecbf76d devices: add device id for Atheros AR9380
0b272ab76dec devices: add device id for Atheros AR9271
1fff99bf766d devices: add device id for Realtek RTL8188EUS
446de2e04a43 devices: add TP-Link Archer T4U v3
0ab4641cfd18 devices: add TP-Link Archer T2U v3
49e3d3fa4752 devices: add device id for Qualcomm Atheros IPQ9574
fa3a2a421dd1 devices: add Realtek RTL8912AU/RTL8922AU
c67b30a5bcc2 devices: add TP-Link TBE400U and ASUS USB-BE93

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/27010
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
2026-12-01 00:12:57 +01:00
David Härdeman 7e7770d865 dnsmasq: watch the hosts directory with --hostsdir
dnsmasq reads the hosts files in /tmp/hosts (its own per-instance files
and odhcpd's) via --addn-hosts, which only rereads them on SIGHUP. So
odhcpd's leasetrigger, odhcpd-update, sends SIGHUP to every dnsmasq
instance whenever its leases change, which also clears the whole DNS
cache and rereads all other hosts files. That spams the log (#6454),
has been suspected of leaking memory (#21729) and is slow with large
hosts files such as block lists since dnsmasq 2.93 (#25826); see also
#8271.

Use --hostsdir instead: dnsmasq then watches the directory with inotify
and only rereads the file that changed. odhcpd replaces its hosts files
by renaming a dotfile, which dnsmasq ignores, over them.

This was done before in commit a03035dad1 ("dnsmasq: use "hostsdir"
instead of "addn-hosts"") and reverted in commit bcf20e0583, because
the directory is shared by all instances and odhcpd still sent SIGHUP.

All instances have read the whole directory since commit 942904f7b9
("dnsmasq: Specify directory /tmp/hosts as argument for --addn-hosts"),
so that they get odhcpd's names, and instances can opt out with
ignore_hosts_dir since commit e8a5670122 ("dnsmasq: add ignore hosts
dir to dnsmasq init script"). This is unchanged here, including that
names leak between instances which don't opt out (#6960, #9145). What
made the sharing a problem for --hostsdir is that the temporary hosts
file of an instance is in the same directory: the other instances read
it while it is written and keep its names after it is renamed (dnsmasq
does not handle IN_MOVED_FROM) until they get a SIGHUP. Make it a
dotfile as well.

The SIGHUP was needed then, as dnsmasq only removes the names of
changed or deleted files in a hosts directory since version 2.88. It is
now redundant and odhcpd-update can be dropped in a follow-up.

Addnhosts entries that are directories would lose their names when a
file in the hosts directory changes, due to a dnsmasq bug fixed by the
previous commit.

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/26658
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-29 11:35:20 +01:00
David Härdeman d61504b463 dnsmasq: fix the hosts index collision with --hostsdir
Hosts files found in an --addn-hosts directory and files in a
--hostsdir directory are numbered independently, starting at the same
value. A change to a --hostsdir file then also flushes the names read
from the --addn-hosts file with the same number, until the next SIGHUP.

This happens with a hostsdir set by the user next to the default
--addn-hosts=/tmp/hosts: e.g. the router's own name, from
/tmp/hosts/dhcp.<instance>, disappears when a file in the hostsdir is
written. Once /tmp/hosts itself is a --hostsdir, it also happens with
every addnhosts entry that is a directory.

Add a patch that numbers all hosts files from the same counter. It
applies to dnsmasq master as well and has been sent upstream:
https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2026q4/018636.html

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/26658
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-29 11:35:20 +01:00
Dirk Brenken a877587b7f odhcp6c: apply the interface metric to RA routes
The 'metric' option of a dhcpv6 interface currently has no effect on
the routes learned from RAs. The dhcpv6.script passes an explicit metric
for every route it hands to netifd (256 for on-link prefixes,
384/512/640 for high/medium/low router preference, as derived by
odhcp6c, 4096 for the fakeroute fallback). netifd treats an explicit
metric as authoritative and does not apply the interface metric on top.
A dhcpv6 interface with 'option metric 10' therefore still installs its
default routes at 512.

This minimal change does the following:
- dhcpv6.sh reads the `metric` option and exports it as METRIC when
  it is set and greater than 0
- dhcpv6.script uses METRIC in place of the RA range: the on-link
  prefix and high/medium/low preference (256/384/512/640) become
  METRIC +0/+1/+2/+3, so the metric ranks the uplink directly against
  other interfaces such as a WireGuard tunnel, as it does on IPv4.
  The fakeroute fallback gets METRIC on top (4096 + METRIC) and stays
  the last resort
- the handler declares metric as a config option of its own, as it
  already does for zone, delegate and ip6ifaceid
- without 'metric' on the interface, nothing changes

Reported in the OpenWrt forum:
https://forum.openwrt.org/t/shunt-policy-based-routing-for-any-dns-backend/252748/52

Tested on x86, OpenWrt SNAPSHOT (r38140-a3ffc9af4e),
PPPoE uplink, explicit dhcpv6 interface on @wan,
'option metric 10', medium router preference):

before:
  default from <pd>/64 via fe80::… dev pppoe-wan metric 512
  default from <pd>/56 via fe80::… dev pppoe-wan metric 512
  <host> via fe80::… dev pppoe-wan metric 512
  <prefix>/64 dev pppoe-wan metric 10

after:
  default from <pd>/64 via fe80::… dev pppoe-wan metric 12
  default from <pd>/56 via fe80::… dev pppoe-wan metric 12
  <host> via fe80::… dev pppoe-wan metric 12
  <prefix>/64 dev pppoe-wan metric 10

Changing the metric (10 -> 5 -> 10 -> unset) with ifdown/ifup is
picked up each time (12 -> 7 -> 12 -> 512); without a metric
the routes are at 512 as before.

Signed-off-by: Dirk Brenken <dev@brenken.org>
Link: https://github.com/openwrt/openwrt/pull/26497
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-29 11:27:02 +01:00
Robert Marko 8cad97a221 odhcpd: update to Git HEAD (2026-11-28)
63d8d486cfcc ubus: don't pass NULL to memmem()
9e843bb9e795 config: default ra_lifetime to ND_PREFERRED_LIMIT
4dbe8564f057 router: don't derive option lifetimes from a zero router lifetime
2182d0c74aa9 router: announce a zero router lifetime for ra_lifetime 0
8b20bfe2d0a7 router: don't cap ra_lifetime at ND_VALID_LIMIT
c7b622e06405 README: document the ra_lifetime range
c62ad95481ec ubus: reconnect when ubusd drops the connection
f048060cf5d2 dhcpv6-ia: reply UnspecFail to Confirms with duplicate IA_NA IAIDs
b95246662467 dhcpv6: add the RFC 9686 message types and option
5103b8c213ef dhcpv6-ia: factor out the client FQDN and DUID MAC parsing
ede33fd053bb config: find host sections by DUID regardless of the IAID
21722063d35e db: add per-interface address and DUID databases
8ccb360eed08 dhcpv6: factor out the server DUID
e577ebab531b dhcpv6: handle ADDR-REG-INFORM (RFC 9686)
e6981002cdfe dhcpv6: announce address registration support
d7faf31101b7 dhcpv6-ia: expire and clean up registered addresses
23315801bd00 dhcpv6-ia: don't assign registered addresses via IA_NA
41841e03eeb3 config: apply ignore changes to existing host sections
1aaca14754f9 config: link host sections to registered clients
3c76b66ab092 statefiles: add registered addresses to the hosts files
0e27663caa40 ubus: report registered addresses in ipv6leases
aebb4a6d9e80 README: mention RFC 9686 address registration
bcf7407c5fc9 github: ci: build with the OpenWrt SDK
f8dc2075d3dc statefiles: always set time in statefiles_ra_pio_time()
5fc7fa331981 router: let router_find_ra_pio() take separate addr/prefix
ab282c002782 router: only store PIO prefix and length
60ab4666d9df router: merge addresses into PIOs by the announced prefix
3ea6317fc7e2 router: don't let a deprecated address deprecate its prefix
378047065483 dhcpv6-ia: ignore address changes while the interface is down
bacad990eceb config: compare IAIDs in the lease cfg key
d12381d4c623 config: add an interface list to host sections
0ceef6fa9d2c dhcpv4: use ciaddr as the requested address when renewing
7849c4a73321 dhcpv6-ia: send Reconfigure to IA_NA clients on address changes
5c1b318e7748 dhcpv6-ia: fix Authentication option length in Reconfigure
9d431940083f dhcpv4: remove the dhcpv4_forcereconf option
9b37a3dac163 dhcpv4: always authenticate FORCERENEW messages
161f5ccda5ee statefiles: remove hosts files that are no longer valid
57f4fec60a53 config: add a per-interface hostsdir option
bbba3f7c9cc8 dhcpv6-ia: use one reconfigure key per client

Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-28 15:04:19 +01:00
Lech Perczak 33636a0fd4 ppp: pptp: support "nohostroute" option
Similar to whats done for Wireguard and GRE, allow skipping registration
of the host route to particular upstream. This is useful for multi-homed
hosts that use PPTP for creating site to site links without need for
default route.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26958
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-28 14:33:47 +01:00
Gunther Stammwitz 5fb8f35f60 hostapd: expose negotiated client security over ubus
Report the selected AKM and pairwise cipher for authorized WPA/RSN
stations in get_clients. Read the values from the station authenticator
state so callers can distinguish clients on mixed WPA2/WPA3 BSSes
and display FT AKMs.

Reuse the hostapd suite names and omit the security object when no
negotiated security is available.

Signed-off-by: Gunther Stammwitz <gstammw@gmx.net>
2026-11-27 21:24:26 +01:00
Andreas Ziegler 088e490be1 wifi-scripts: fix mesh basic_rate fallback and AP rate leak
Multiple remaining netifd/wifi-scripts bugs broke device-level
basic_rate fallback or leaked AP rate settings onto co-located
interfaces:

- mac80211.sh: Fix `data.config.basic_rate` -> `data.config.basic_rates`
  when populating the wdev fallback config.
- wireless.wifi-iface.json: Add the missing numeric `items` type for
  `basic_rate`.
- supplicant.uc: Fall back to device-level `data.basic_rates` only for
  `mesh` and `adhoc` interfaces when interface-level `basic_rate` is
  unset.
- hostapd.sh: Scope `basic_rate_list` and `rate_list` as `local` in
  `hostapd_prepare_device_config()` so AP `legacy_rates=0` /
  `cell_density` settings do not leak into subsequent wpa_supplicant
  interfaces on the same radio, and restrict device-level fallback in
  `wpa_supplicant_add_network()` to `mesh` and `adhoc`.

Link: https://github.com/openwrt/openwrt/issues/15826
Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
2026-11-27 20:49:35 +01:00
David Bauer 879a757542 hostapd: add help text for -n option
The text for the custom -n option was missing from the help output.

Signed-off-by: David Bauer <mail@david-bauer.net>
2026-11-27 20:38:17 +01:00
Tyrel M. McQueen cdc3827a7b dnsmasq: cherrypick upstream to fix CVEs/vulns (2)
Yesterday, the maintainer of dnsmasq, Simon Kelley, posted a change
to the dnsmasq security patch process, in which patches for security
issues are posted directly to the public git, before any CVE
assignment. New release versions with an embargo process is reserved
for "catastrophic" vulnerabilities:

https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2026q4/018646.html

This commit cherry picks additional security-related upstream fixes,
including those identified by @JohnsterID in #26340. Specifically:

001: https://thekelleys.org.uk/gitweb-noai/?p=dnsmasq.git;a=commit;h=c310853907a09050fd9aaa71d459dda190d113e1
002: https://thekelleys.org.uk/gitweb-noai/?p=dnsmasq.git;a=commit;h=ea9bd30cd4a42dfe773bb7419b36be3ace66a5ba
003: https://thekelleys.org.uk/gitweb-noai/?p=dnsmasq.git;a=commit;h=ea4645d52cfac5399848a4f705da28f2f9736956
004: https://thekelleys.org.uk/gitweb-noai/?p=dnsmasq.git;a=commit;h=7a663fd46b9f63b3cc49b77b2dc50a1ed94c3428
014: https://thekelleys.org.uk/gitweb-noai/?p=dnsmasq.git;a=commit;h=2463798e0322e1586d16970e7d5f60fd7a864f29
015: https://thekelleys.org.uk/gitweb-noai/?p=dnsmasq.git;a=commit;h=10fbc39cf57220eb93f61ce282d7561750f8d29d

Existing patches 001-009 are renumbered to 005-013.

Note that 015 primarily fixes a caching regression introduced by 013, but may
also be considered security relevant due to the greater DoS possibility,
especially when dnssec is enabled.

These patches can be removed once DNSMASQ 2.94 is released.

Signed-off-by: Tyrel M. McQueen <tmcqueen.materials@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26966
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-27 11:20:32 +01:00
Pierre Gaufillet 5dddea8513 dnsmasq: add ubus lease management methods
Add three ubus methods to dnsmasq's existing ubus interface:
- add_lease: inject a DHCP lease (IPv4/IPv6) via ubus
- delete_lease: remove a lease by IP address
- get_leases: enumerate all active leases as JSON

These methods provide ubus parity with dnsmasq's existing D-Bus
AddDhcpLease/DeleteDhcpLease (since v2.73), with improvements:
script suppression for HA setups, hostname validation, correct
IPv6 domain lookup, and lease enumeration (no D-Bus equivalent).

The patch follows the same patterns as the existing ubus metrics
and set_connmark_allowlist methods. ~400 lines, all behind
#ifdef HAVE_DHCP guards.

Also submitted upstream to dnsmasq-discuss. If accepted upstream,
this carried patch can be dropped.

Tested on: OpenWrt 25.12 (x86_64 + filogic), production.

Signed-off-by: Pierre Gaufillet <pierre.gaufillet@bergamote.eu>
Link: https://github.com/openwrt/openwrt/pull/22904
Signed-off-by: Nick Hainke <nick.hainke@posteo.de>
2026-11-25 22:06:08 +01:00
Martin PeckaandSemih Baskan 7d85088f22 ppp: fix default config
Co-authored-by: Semih Baskan <strst.gs@gmail.com>
Signed-off-by: Martin Pecka <peci1@seznam.cz>
Link: https://github.com/openwrt/openwrt/pull/24396
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-24 11:47:47 +01:00
Martin Pecka d522c00359 ppp: update MPPE options in PPTP configuration
After the update of ppp to 2.5.0 (in 9cecf2b), the MPPE library implementation changed.

This commit updates the sample file to conform to the config syntax of the new library.

Signed-off-by: Martin Pecka <peci1@seznam.cz>
Link: https://github.com/openwrt/openwrt/pull/24396
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-24 11:47:47 +01:00
Zakk P 14a07b78e9 hostapd: ucode: free the link ID of a deleted MLD BSS
bss_delete and a failed add_bss drop the AP MLD reference by hand but
leave the link ID set in used_link_ids. Adding the link back then fails
with "Link ID N already in use" and the link stays out of the AP MLD,
as seen with the 6 GHz link of a GL-BE9300 after wifi reload.

Drop the reference with hostapd_mld_ref_dec(), which also clears the
link ID bit, and export it from hostapd.c like the other helpers used
by ucode.c.

Signed-off-by: Zakk P <zakk@gentoozh.org>
Link: https://github.com/openwrt/openwrt/pull/26807
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-11-22 18:14:57 +01:00
Oldřich Jedlička 0e66e1c745 hostapd: backport the VLAN of the PSK on FT-PSK roaming
With ft_psk_generate_local=1, the default for FT with a PSK, hostapd
does not look at the VLAN ID that a PSK in wpa_psk_file has
(vlanid=<VLAN ID>) when a station roams with FT. The station then drops
out of the VLAN of its PSK onto the interface of the BSS. A wifi-station
section with a vid gives a PSK such a VLAN ID.

hostap main fixes this with commit ad66108dbc5a, which is not in the
2.12 release that the package pins:
https://git.w1.fi/cgit/hostap/commit/?id=ad66108dbc5a8a28b7164c6cd05eda6550f94481

Backport it as patch 927.

A PSK lookup that asks for the VLAN ID also sets psk_idx, so the
sta_connected ucode hook now gets the psk_idx after an FT-PSK roam too.

Tested on a TP-Link Archer C7: after an FT-PSK roam, a station whose
PSK has vlanid=1 stayed in VLAN 1 ("AP-STA-CONNECTED ... vlanid=1
auth_alg=ft").

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
Assisted-by: Claude:claude-opus-5-5
Link: https://github.com/openwrt/openwrt/pull/26864
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-22 12:56:20 +01:00
Guy Godfroy ecd9120f04 wireguard-tools: contain a refused peer value to its line
wg's config parser refuses the whole configuration for one bad value,
so since the ucode rewrite a peer section holding one value the parser
refuses (an endpoint hostname that does not resolve, a malformed
preshared key, a keepalive that is not a number) takes the whole
interface down, and netifd's retry keeps it down until the section is
fixed (#24511).

This checks each peer value against wg's own grammar while the
configuration is built, and a refused one costs its line instead of the
tunnel: an endpoint that does not resolve omits its Endpoint= line (the
peer stays installed and reachable inbound, and wg fills the endpoint in
from the first authenticated handshake, as the watchdog already relies
on), a malformed preshared key or a keepalive that is neither 0-65535
nor off omits its line, and a public_key that is not a WireGuard key
skips the peer. Every refusal is logged with the interface, the peer's
uci section and public key, and the refused value, so the operator can
find the offending section; a peer section without a public_key is
skipped and logged too. The preshared key warning stays valueless,
because a key is a secret. The happy path is unchanged: one atomic
syncconf, peer removals included. PKG_RELEASE is bumped so users on
main receive it.

Reviewer questions, answered:
- a malformed PresharedKey omits its line only, the peer keeps running
  without it, an optional value fails open on its line rather than
  closed on the peer;
- AllowedIPs entries stay unvalidated here, wg remains the judge,
  because a false omission would cost routes;
- endpoint names resolve through nslookup at each setup, ucode has no
  getaddrinfo and wg set cannot run from the handler without touching
  the live interface.

Fixes #24511.

Assisted-by: OpenCode:mistral-large-4-0
Signed-off-by: Guy Godfroy <guy.godfroy@gugod.fr>
Link: https://github.com/openwrt/openwrt/pull/26543
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-18 19:30:19 +01:00
David Härdeman 44fe8950f4 odhcpd: update to Git HEAD (2026-11-17)
4580970dabfb config: write pending state changes on exit
3a82f5cc6495 dhcpv6-ia: lazy store statefiles
acc9fb073a49 dhcpv6-ia: update the state files when DHCPv6 leases expire
c4d2cc04ac94 ubus: add dhcp.hosts.update event

Change: https://github.com/openwrt/odhcpd/compare/1c66296296c5...4580970dabfb
Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/26783
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-18 19:18:15 +01:00
Andy Chiang 2a425bf0a4 odhcpd: update to Git HEAD (2026-11-16)
odhcpd: update to Git HEAD (2026-11-16)

1c66296296c5 dhcpv4: clamp pool to subnet with most available hosts
03eebc9b2c08 dhcpv4: fix pool limit being ignored when start is unset
f97b5d335c51 dhcpv6-ia: skip invalid parent prefixes for PD routes

Change: https://github.com/openwrt/odhcpd/compare/26aa64a0bd81...1c66296296c5

Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/26770
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-17 10:56:56 +01:00
Nicolás Capdet e7d06ddb4e wifi-scripts: drop legacy rates with require_mode
With `require_mode` set, `hostapd.sh` clears `legacy_rates` before it
picks the `cell_density` rates. `generate()` in `hostapd.uc` clears it
only after `device_cell_density_append()` has run, and nothing reads it
afterwards. A 2.4 GHz radio with `legacy_rates 1` therefore keeps the
802.11b rates: 5.5 and 11 Mbps as basic rates with `cell_density 1`,
11 Mbps with `cell_density 2`, and no rate lines with `cell_density 0`,
which leaves the hostapd defaults.

Call `device_cell_density_append()` after the `require_mode` check. It
only sets the rate defaults that `ap.uc` writes for each BSS, so the
rest of the generated config stays the same.

Fixes: 218f3884d2 ("wifi-scripts: add ucode based scripts")
Link: https://github.com/openwrt/openwrt/issues/26580
Signed-off-by: Nicolás Capdet <nicolas@tedpac.xyz>
Link: https://github.com/openwrt/openwrt/pull/26587
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-16 21:05:03 +01:00
Nicolás Capdet 14b318cf94 wifi-scripts: use legacy_rates for cell_density 3
On a 2.4 GHz radio with `legacy_rates 1`, `hostapd.sh` treats
`cell_density 3` like `cell_density 2` and uses 11 Mbps as the basic
rate, as described in commit 81ff23fc91 ("hostapd: Add cell_density
data rates option"). `hostapd.uc` tests `cell_density > 3`, which is
never true because the schema caps the option at 3, so the radio gets
24 Mbps as the basic rate.

Test `cell_density > 2` instead, and mention the exception in the
schema description.

Fixes: 218f3884d2 ("wifi-scripts: add ucode based scripts")
Link: https://github.com/openwrt/openwrt/issues/26580
Signed-off-by: Nicolás Capdet <nicolas@tedpac.xyz>
Link: https://github.com/openwrt/openwrt/pull/26587
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-16 21:05:03 +01:00
Christopher Griffin 5b24069798 hostapd: ucode: don't crash in set_bss_order() on a BSS that is gone
iface.set_bss_order() takes the struct hostapd_data of every listed BSS
from its ucode resource and dereferences it without a check. When the
list holds a BSS object whose hostapd_data has already been freed, the
resource data is NULL and hostapd crashes with SIGSEGV.

Seen on an OpenWrt One: a reload whose only change was the radios' TX
power went down iface_reload_config()'s BSS path for one radio, and all
four BSS objects it then passed to set_bss_order() were already empty
(read from the core dump). The crash took every BSS on both radios
down until netifd restarted Wi-Fi.

Treat such an entry like one that belongs to another interface and
return null: the reload then logs "Failed to update BSS order" and
restarts only that radio.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Christopher Griffin <christophergriffin05@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26635
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-16 21:02:20 +01:00
Christopher Griffin f48fd61568 wifi-scripts: ath12k trigger: also match the ath12k_wifi7_pci driver
11-ath12k-trigger restarts an ath12k radio whose setup failed because
the device appeared after the wireless configuration was applied. It
only acts on devices bound to ath12k_pci, but since ath12k was split
into a common module and ath12k_wifi7, the PCI driver is named
ath12k_wifi7_pci, so on current kernels the script never acts. Match
both names.

Seen on an Arista C-460 (IPQ9574, three QCN9224 on PCIe), where the
new match finds the three ath12k radios and leaves the ath11k one
alone.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Christopher Griffin <christophergriffin05@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/26636
Signed-off-by: Robert Marko <robimarko@gmail.com>
2026-11-16 20:46:09 +01:00
Felix Fietkau 69cc7d9c04 hostapd: follow the AP Removal Timer that the driver applies
hostapd timed the stop of a removed link and its reply to the caller
from the count that it asked for, while the driver can remove the link
at a larger count.

Take the count and the removal TBTT from
NL80211_CMD_AP_REMOVAL_TIMER_STARTED. Without that report, the times of
an offloaded removal hold three beacon intervals after its start. The
ucode method link_remove adds `timed`, the new method
link_remove_times reads the times, and the hook bss_link_remove_timed
tells hostapd.uc when they hold. The ubus method mld_link_remove defers
its reply until then, so that its caller waits for the stop of the link
at the count of the driver.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau e262431d2b hostapd: run one removal of an affiliated AP at a time
A removal of a link while the removal of another link of the AP MLD
runs either fails, where the driver counts one removal at a time, or
overlaps the first, which a station can miss.

Queue such a request and start it when the removals before it ended.
The reply gives the removal and expiry times with the wait included.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau a23edaa4ea hostapd: hold the beacons that the driver refuses during a removal
Patch 822 holds every beacon update of the AP MLD while the driver
counts the AP Removal Timer. It also refuses a removal whose count is no
whole number of seconds, and a removal while another one runs. Only a
driver that takes the timer of each new beacon as a new start needs the
hold, and hostapd cannot tell such a driver from one that counts the
timer per TBTT.

mac80211 now refuses the beacon changes of the AP MLD with -EBUSY for a
driver that needs the hold. Change patch 822 to take a refused beacon
set as held, and to start a link whose start was refused at the expiry.
Drop the whole-second check and the refusal of a second removal. End
the removal of every link that an expiry event reports.

mac80211 also refuses a channel switch on the channel of a held AP MLD.
Stop the ubus channel switch at the first BSS that refuses it, as the
ucode one does, so that DFS takes its fallback.

Refresh patches 827 to 883.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau 29278064eb hostapd: ubus: let del_client deauthenticate at once
del_client with deauth gives an associated station a Disassociation
first and the Deauthentication 2 s later. A caller that needs the
Deauthentication frame at once, as the DEAUTHENTICATE control command
sends it, cannot ask for it.

Add deauth_now: with deauth, it sends the Deauthentication at once from
the BSS that holds the station, also to an associated one. It replaces
a Deauthentication that an earlier call still holds back for the
address. An older hostapd ignores the attribute.

The replaced Deauthentication keeps the mark that holds the station in
the driver, since the Disassociation callback of the earlier call can
still run while the new frame waits in the driver.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau f2b27e8544 hostapd: ubus: disassociate before del_client deauthenticates
A driver can hold a Disassociation frame for a station in power save
until the station wakes, but send a Deauthentication frame at once
(mt76 sends it on the ALTX queue), so a dozing station misses the frame
of a del_client with deauth.

For a station with WLAN_STA_ASSOC, del_client with deauth now sends a
Disassociation with the reason, and the Deauthentication with the same
reason 2 s later. Where the Disassociation is not acknowledged, the
mark of patch 924 keeps the station in the driver with its keys. The
Deauthentication then goes protected, as a station with MFP drops an
unprotected one. An Authentication or (Re)Association of the address
that hostapd accepts cancels the pending Deauthentication.

Each frame of del_client now goes from the BSS that holds the station.
The first link of an AP MLD sent it before, also for a non-MLD station
of another link, which never got the frame.

Document in the README what deauth sends.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau 3586d40fb1 hostapd: optionally keep a STA whose Disassociation was not acknowledged
ap_sta_disassoc_cb() removes the STA from the driver at the TX status of
the Disassociation frame, whether or not the STA acknowledged it, and
the two second timeout of the callback does the same. A caller that
sends a Deauthentication frame after the Disassociation then sends it
without the pairwise key of the STA, and a STA with MFP drops it.

Add a patch that passes the ACK of the Disassociation to
ap_sta_disassoc_cb(). For a STA whose caller sends a Deauthentication
after the Disassociation, a Disassociation without ACK and the timeout
leave the STA in the driver with its keys, and the callback of the
Deauthentication removes it. An acknowledged Disassociation removes the
STA as before. A new authentication or association ends the mark with
the other pending callbacks.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau e8e130a85f hostapd: ignore a Deauth/Disassoc TX status after its callback ended
WLAN_STA_PENDING_DEAUTH_CB and WLAN_STA_PENDING_DISASSOC_CB mark the
callback that the TX status of a Deauthentication or Disassociation
frame runs. Only ap_sta_deauth_cb() and ap_sta_disassoc_cb() clear
them, so the flag stays set where the two second timeout runs the
callback first, or where ap_sta_clear_disconnect_timeouts() cancels it
for a new authentication or association. A later TX status of the
frame, for example from a driver that holds the frame for a STA in
power save until the removal flushes it, then runs the callback again.
It removes the STA from the driver a second time, or removes the new
association of a STA that came back within the wait.

Add a patch that clears the flag where the callback runs, from the TX
status or from the timeout, and where
ap_sta_clear_disconnect_timeouts() cancels it. A later TX status of the
frame is then ignored, as that of a test frame is.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau b2ece03818 hostapd: ucode: notify the end of a link removal
A client that applies its next configuration after the AP removal of a
link cannot tell when that removal ends. The bss.remove notification
names no radio, and an AP MLD has its name on each of its links, so add
bss.link_removed with the radio of the link that stopped.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau 8e3f6ad698 wifi-scripts: add mlo_emlsr and mlo_emlmr for an AP MLD
A false value writes mld_emlsr=0 or mld_emlmr=0 into the hostapd
configuration of the AP MLD, so that it does not advertise the mode.
An unset option writes no key and keeps the driver's modes.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau cfae1f57f8 hostapd: add mld_emlsr and mld_emlmr for an AP MLD
The EML Capabilities of an AP MLD come from the driver alone, so the
configuration cannot turn off EMLSR or EMLMR. Add the per-BSS keys
mld_emlsr and mld_emlmr, 1 by default: a 0 clears the support bit of
the mode. Where neither support bit remains, also for a driver without
EMLSR and EMLMR, the Basic Multi-Link element omits the EML
Capabilities, as IEEE Std 802.11be-2024 35.3.17 requires.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau 0ea98a49b3 hostapd: report each refused connection attempt on ubus
The only ubus notification of a failed connection is key-mismatch, which
names neither the status the station got nor, for a wrong PSK, the frame
of the failure. A refusal for any other reason goes unreported.

Notify connect-refused at the reply of each refused Authentication and
(Re)Association Request, with the status and, where the handler has the
frame, the frame body. It names the MLD address of a client MLD.
key-mismatch now names the status of its reply, and for a wrong PSK the
EAPOL-Key message 2.

With a driver that has its own AP SME, for example brcmfmac or
mwifiex, the station gets a Disassociation frame instead. Then
connect-refused gives its Reason Code in the new reason field and no
status.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00
Felix Fietkau ce7623459c hostapd: tell a CAC through the hostapd ubus object
The ubus object of a BSS does not exist while hostapd runs a CAC, and
the kernel sends no NL80211_RADAR_CAC_STARTED for a CAC that hostapd
starts, so no client can see a CAC that hostapd runs by itself.

Notify cac_start on the hostapd object when the driver takes the CAC,
and add the running CAC to the status method of that object, with the
frequency, the operating class, the primary channel, the CAC time and
the time that passed, for a client that started during the CAC. A CAC on
a background radar chain leaves the interface on its own channel and
stays out.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-11-15 11:17:21 +00:00