Commit graph

67141 commits

Author SHA1 Message Date
Mieczyslaw Nalewaj
17d625c858 ramips: remove obsolete SPI flash nodes after kernel fix
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Remove incomplete SPI flash definitions from affected device tree files.
These fragments only defined address-cells and size-cells without any
actual flash configuration (partitions, compatible string, etc.).

After applying openwrt/openwrt#20942 ("kernel: of: fix bad cell count error
for SPI flash node"), the kernel properly handles SPI flash nodes without
requiring these incomplete definitions in device-specific DTS files.

This cleanup eliminates unnecessary code that was likely a workaround for
the previous kernel issue.

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/22036
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 313d563664)
2026-02-20 10:19:00 +01:00
Felix Fietkau
e370701a57 uclient: update to Git HEAD (2026-02-20)
7a0aa2e4afb4 uclient-http: fix data_eof for body-less responses

Fixes: https://github.com/openwrt/openwrt/issues/22103
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-02-20 09:08:45 +00:00
Felix Fietkau
e2089a5d3e hostapd: fix dealing with required interface restart in AP+STA mode
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Ensure that the BSS start_disabled option is always cleared, so that
interfaces come up properly.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit b7cd16dba3)
2026-02-19 15:14:47 +00:00
Yaroslav Isakov
ad24a28363 hostapd: fix EAP-PWD in experimental hostapd-radius server
Without initializing pwd_group, it's set to 0, which is reserved value.
When EAP-PWD is used in wpa_supplicant/eapol_test, next error is seen:
EAP-PWD: Server EAP-pwd-ID proposal: group=0 random=1 prf=1 prep=0
EAP-pwd: Unsupported or disabled proposal

Signed-off-by: Yaroslav Isakov <yaroslav.isakov@gmail.com>
(cherry picked from commit 9d78b2f53c)
2026-02-19 15:14:16 +00:00
Chad Monroe
ae2fbe48d2 hostapd: initialize first BSS radio_mask during driver init
Secondary BSSes inherit the alloc value which bypasses
NL80211_ATTR_VIF_RADIO_MASK in nl80211_create_iface() and causes the
kernel to default new interfaces to all radios.

The ucode bss_create fallback fails to correct this because
the interface is already UP.. the kernel rejects SET_INTERFACE with
-EBUSY.

Signed-off-by: Chad Monroe <chad@monroe.io>
(cherry picked from commit 50d3d287e4)
2026-02-19 15:14:16 +00:00
Hauke Mehrtens
9cbdc2056b OpenWrt v25.12.0-rc5: revert to branch defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-19 02:16:14 +01:00
Hauke Mehrtens
b36d5e3da0 OpenWrt v25.12.0-rc5: adjust config defaults
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-19 02:16:11 +01:00
Hauke Mehrtens
482ba7230a ucode-mod-bpf: add CPPFLAGS
Some checks failed
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit c3f2a09a25)
2026-02-17 22:30:37 +01:00
Hauke Mehrtens
9cd17a1064 ebtables: add CPPFLAGS
Add the OpenWrt CPPFLAGS to the CFLAGS. ebtables does not
support CPPFLAGS. This fixes fortify sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 77d896725f)
2026-02-17 22:30:35 +01:00
Hauke Mehrtens
5884c75aad arptables: add CPPFLAGS
Add the OpenWrt CPPFLAGS to the CFLAGS. arptables does not
support CPPFLAGS. This fixes fortify sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 33b2c6f955)
2026-02-17 22:30:34 +01:00
Hauke Mehrtens
5f724fc319 iwinfo: add CPPFLAGS
Add the OpenWrt CPPFLAGS to the FLAGS. iwinfo does not support CPPFLAGS.
This fixes fortify sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 379d5b8bc4)
2026-02-17 22:30:33 +01:00
Hauke Mehrtens
acad156c06 zyxel-bootconfig: add CPPFLAGS
Add the OpenWrt CPPFLAGS to the CFLAGS. zyxel-bootconfig does not
support CPPFLAGS. This fixes fortify sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b8ea5004f4)
2026-02-17 22:30:32 +01:00
Hauke Mehrtens
e0bad5bf1f ravpower-mcu: add CPPFLAGS
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit ddb1c1ab33)
2026-02-17 22:30:30 +01:00
Hauke Mehrtens
9bb7755066 wireless-tools: add CPPFLAGS
Add the OpenWrt CPPFLAGS to the CFLAGS. wireless-tools does not
support CPPFLAGS. This fixes fortify sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit d69b283068)
2026-02-17 22:30:28 +01:00
Hauke Mehrtens
551beecf59 resolveip: add CPPFLAGS
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0f1c1c581f)
2026-02-17 22:30:27 +01:00
Hauke Mehrtens
0cd63fda4c iwcap: add CPPFLAGS
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit bfd57eab3d)
2026-02-17 22:30:26 +01:00
Hauke Mehrtens
9f88e5c743 libcap: add CPPFLAGS
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.

Allow to extend the CPPFLAGS and not only overwrite.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 53e6935960)
2026-02-17 22:30:24 +01:00
Hauke Mehrtens
afbcaa4525 bzip2: add CPPFLAGS
Add the OpenWrt CPPFLAGS to the CFLAGS. bzip2 does not support CPPFLAGS.
This fixes fortify sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit cd1fda5c8b)
2026-02-17 22:30:23 +01:00
Hauke Mehrtens
da0b16367c 6rd: add CPPFLAGS
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b497c3f68f)
2026-02-17 22:30:21 +01:00
Hauke Mehrtens
790aaa5b07 464xlat: add CPPFLAGS
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 2ca7c2b846)
2026-02-17 22:30:20 +01:00
Hauke Mehrtens
361be894b3 gdb: add CPPFLAGS
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 39e5f11631)
2026-02-17 22:30:19 +01:00
Hauke Mehrtens
370af1aa65 binutils: add CPPFLAGS
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.

Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 35939e4db9)
2026-02-17 22:30:17 +01:00
John Audia
bdc594e0af tools: m4: update to 1.4.21
Some checks failed
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Changelog: https://github.com/autotools-mirror/m4/blob/branch-1.4/NEWS

This update fixes a build error on my system:
./string.h:777:20: error: expected identifier or '(' before '_Generic'
  777 | _GL_EXTERN_C void *memchr (const void *__s, int __c, size_t __n)
      |                    ^~~~~~

Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21987
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit ce9a0ff3fb)
2026-02-17 20:30:27 +01:00
Edward Chow
42ad77a4a6 bcm53xx: fix target name of meraki_mx64-a0
Some checks failed
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
The target name of meraki_mx64-a0 in
target/linux/bcm53xx/image/Makefile used not to be consistent with the
one defined in target/linux/bcm53xx/base-files/lib/upgrade/platform.sh
and generates warning for "Image check failed" during sysupgrade.

This commit would also make the target name for meraki_mx64-a0 to
conform to the openwrt standard.

Signed-off-by: Edward Chow <equu@openmail.cc>
Link: https://github.com/openwrt/openwrt/pull/22034
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 625f01cd80)
2026-02-17 01:47:55 +01:00
Hauke Mehrtens
576aa04151 ath79: add env-size for Sitecom WLR-7100 / WLR-8100 u-boot-env
The Linux kernel assumes that the u-boot environment covers the full
partition, but it only covers 0x1000 bytes. Linux checks the CRC and
does this over the full partition. This fails like this:
```
u-boot-env-layout 1f000000.spi:flash@0:partitions:partition@30000:nvmem-layout: Invalid calculated CRC32: 0xfcac8c41 (expected: 0x14e6335a)
u-boot-env-layout 1f000000.spi:flash@0:partitions:partition@30000:nvmem-layout: probe with driver u-boot-env-layout failed with error -22
```

Define the u-boot environment with a length of 0x1000 bytes to calculate
the CRC only over this area.

When replicating the u-boot environment with these parameters it
generates the same CRC:
```
mkenvimage -p 0 -b -s 0x1000 -o output.bin input.txt
```

Fixes: https://github.com/openwrt/openwrt/issues/21696
Fixes: 5e3a602def ("ath79: sitecom,wlrx100: use nvmem")
Link: https://github.com/openwrt/openwrt/pull/22030
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 68a466b698)
2026-02-17 01:47:48 +01:00
Hauke Mehrtens
ff3fad172d build: pass CPPFLAGS to cmake build
The TARGET_CPPFLAGS contain the include paths used by OpenWrt. This also
contains the including of the fortify sources headers. If they are not
provided, the applications will not use fortify sources headers when
compiled against musl. Add them to cmake builds too. cmake does not
support a special CPPFLGS option [0], just add them to CFLAGS and
CXXFLAGS like we also do it for meson and normal make.
This should fix fortify sources support for cmake builds.

I found this explanation for the flags:
 * CFLAGS: C flags, passed during compile AND link
 * CXXFLAGS: C++ flags, passed during compile AND link
 * CPPFLAGS: pre-processor flags, passed ONLY during compile
 * LDFLAGS: linker flags, passed ONLY during link

[0]: https://gitlab.kitware.com/cmake/cmake/-/issues/12928

Link: https://github.com/openwrt/openwrt/pull/22042
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 7bf8d568f6)
2026-02-17 01:47:41 +01:00
Hauke Mehrtens
eddb6342cd fortify-headers: fix -Werror=format-nonliteral in fortify/stdio.h
Some applications might activate -Werror=format-nonliteral when building
their application. This breaks fortify headers build. Tell GCC to ignore
such warnings for this code.

This fixes the libubox and ucode build:
```
/include/fortify/stdio.h: In function 'snprintf':
/include/fortify/stdio.h:101:9: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
  101 |         return __orig_snprintf(__s, __n, __f, __builtin_va_arg_pack());
      |         ^~~~~~
/include/fortify/stdio.h: In function 'sprintf':
/include/fortify/stdio.h:110:17: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
  110 |                 __r = __orig_snprintf(__s, __b, __f, __builtin_va_arg_pack());
      |                 ^~~
/include/fortify/stdio.h:114:17: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
  114 |                 __r = __orig_sprintf(__s, __f, __builtin_va_arg_pack());
      |                 ^~~
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.
```

Link: https://github.com/openwrt/openwrt/pull/22042
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b237266640)
2026-02-17 01:47:35 +01:00
Hauke Mehrtens
ba34bdca3d fstools: update to Git HEAD (2026-02-15)
8d377aa627be libfstools: Rename PATH_MAX to MTD_PATH_MAX

Link: https://github.com/openwrt/openwrt/pull/22042
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0f4e4a41b2)
2026-02-17 01:47:28 +01:00
Rosen Penev
d66fc6e86f lantiq: handle EPROBE_DEFER for MAC
If nvmem is used for ethernet mac address, we need to defer loading to
get the proper mac.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21955
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit fb71774232)
2026-02-17 01:47:14 +01:00
Tomáš Macholda
42b10de18d mvebu: add support for RIPE Atlas Probe v5
RIPE Atlas Probe v5 is a network measurement device based on Turris MOX.

u-boot bootscript supports booting both from the original Turris BTRFS
layout and default OpenWrt ext4 boot + root partition layout.

Specifications:
* SoC: Marvell ARMADA 3720
* RAM: 512 MiB, DDR3
* eMMC: 4G
* Ethernet: 1x 1GbE

MAC:
LAN MAC: label on board

Flash instructions:
* For using the default ext4 layout, boot into a live system using
tftpboot in u-boot and flash an OpenWrt SD image onto /dev/mmcblk0.
* For the Turris layout, put the new rootfs into subvolume '@', not
forgetting to add Image, device tree, and boot.scr to /boot.

Misc:
* USB connection is only for power. For UART access use the pin header:
  1: GND
  2: +1.8V
  5: TX
  6: RX
* Flashing the image onto Turris Shield won't work. Use Turris MOX image
  instead.

Signed-off-by: Tomáš Macholda <tomas.macholda@nic.cz>
Link: https://github.com/openwrt/openwrt/pull/20031
(cherry picked from commit 0271f2ee36)
Signed-off-by: Trix Taiclet <git@trix.moe>
Link: https://github.com/openwrt/openwrt/pull/22048
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-02-17 01:40:00 +01:00
Felix Fietkau
5c0a038ed3 udebug: update to Git HEAD (2026-01-16)
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
c5c493ed5787 udebug-cli: fix reference to invalid variable in error message
875e1a7af6ca udebug-cli: add logdump command

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 55c498eb7b)
2026-02-16 08:20:29 +00:00
Harin Lee
16dcfc613a wifi-scripts: fix macaddr check in mac80211.uc
This fixes a simple logic error in the macaddr existence check in mac80211.uc.

Signed-off-by: Harin Lee <me@harin.net>
Link: https://github.com/openwrt/openwrt/pull/21277
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 2ebcda1ea6)
2026-02-16 08:20:29 +00:00
Felix Fietkau
4ab2e3d0dd wifi-scripts: wireless.uc: add MLO support for procd service data
This allows services to dynamically configure MLO interfaces without
using UCI.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 0a8bccf85d)
2026-02-16 08:20:29 +00:00
Felix Fietkau
4305911499 wifi-scripts: move the "disabled" option to the wifi-iface section
This helps for setups where the wifi interfaces are added dynamically
via procd data by avoiding automatically bringing up interfaces with
the default config. Internally, they are treated pretty much the same
by netifd.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 79a0aebd81)
2026-02-16 08:20:29 +00:00
Felix Fietkau
f867497e35 wifi-scripts: netifd: fix null dereference in config_init for missing devices
Add optional chaining when accessing device config in the wifi-iface
loop to handle cases where a referenced device doesn't exist.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 8b994ed397)
2026-02-16 08:20:22 +00:00
Felix Fietkau
3e3f325063 wifi-scripts: fix nested config accumulation in wdev_set_data
When storing device-level data, wdev_set_data() spread the entire wdev
object into handler_data. Since handler_config.data is set from the
previous handler_data[wdev.name] before each setup, this created
exponentially growing nesting with each reload, eventually causing
"nesting too deep" JSON parse errors.

Fix by initializing cur to a simple object containing only the device
name instead of the entire wdev object.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 68c2ab8f5f)
2026-02-16 08:14:41 +00:00
Felix Fietkau
53f88bd15b wifi-scripts: iwinfo.uc: cache survey data in iface object
Extract survey fetching into get_survey() and store results in iface.survey,
allowing access to full survey info (not just noise) for later use.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit e855f32bdd)
2026-02-16 08:13:24 +00:00
John Crispin
8725a4713e wifi-scripts: refactor iwinfo.uc to support dynamic data updates
Moved interface discovery and data population into an exported update()
function that can be called on-demand to refresh wireless interface
information. This allows using iwinfo.uc as a library inside daemons.

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 26eab84f81)
2026-02-16 08:13:24 +00:00
Felix Fietkau
765130cea1 uclient: update to Git HEAD (2026-02-13)
63413daa8760 uclient-http: fix HTTP authentication after deferred header processing
4fa6fae02f74 uclient-fetch: Extract opt_post variable
8df3120639a4 uclient-fetch: Use HEAD for --spider
0392dfc8e8c4 uclient-fetch: Support of --method, --body-data and --body-file
115c92824b6d uclient-fetch: add OPTIONS request type
a1531e89f6c2 uclient-fetch: support for WebDAV methods

Fixes: https://github.com/openwrt/uclient/issues/14
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 88f3c0eeb0)
2026-02-16 08:11:36 +00:00
Felix Fietkau
4b37510109 uclient: update to Git HEAD (2026-01-31)
b3ee1209a3d0 uclient-http: reset fd to -1 after close in disconnect
9c2ad269c42b uclient-http: fix seq field check to use correct field
80c9bd29c233 uclient-http: fix hang on HTTP to HTTPS redirect
931bbfeb2c92 ucode: fix memory leak when using ssl context

Fixes: https://github.com/openwrt/uclient/issues/11
Fixes: https://github.com/openwrt/uclient/issues/13
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 9d496dfb98)
2026-02-16 08:11:36 +00:00
Felix Fietkau
84fec0d218 libubox: update to Git HEAD (2026-02-13)
d324c0503040 libubox: send warnings to stderr
5a65cb5a79b7 libubox: document positional arguments
8c7b489daa02 libubox: add anonymous strings, ints, et al in arrays
5ec7ff2effb3 uloop: use volatile sig_atomic_t for do_sigchld flag
0efa2cd3b74c usock: check SO_ERROR after poll in usock_inet_timeout()
1a73ded9f738 usock: fix timeout handling in usock_inet_timeout()
1aa36ee774c8 usock: implement RFC 8305 Happy Eyeballs for usock_inet_timeout()

Fixes: https://github.com/openwrt/uclient/issues/8
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 7bc8aa492f)
2026-02-16 08:11:03 +00:00
Felix Fietkau
29c2315b1d ucode: add ubus fixes
- avoid double close of externally owned channel fds
- fix refcounting bug

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit e9d6025725)
2026-02-16 08:10:30 +00:00
John Crispin
130466783a procd: reload_config: support UCI overlay directory
Check /var/run/uci/ before /etc/config/ so that overlay configs
also trigger service reload events.

The overlay directory takes precedence, and uci show already handles
merging overlay + base configuration correctly.

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit aaa2d9f1e5)
2026-02-16 08:09:16 +00:00
John Crispin
3091dbcb45 unetmsg: notify subscribers when remote peer connection drops
When a remote peer's connection drops (device powered off, unetmsgd
crash, network failure), network_rx_cleanup_state silently removed
the remote publish/subscribe handles without notifying local
subscribers. This meant local clients had no way to detect that a
remote peer had disappeared.

Call handle_publish for each channel where a remote publish handle
is removed during connection cleanup, so local subscribers receive
the publisher change notification and can react accordingly.

Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit 7fd71f2c74)
2026-02-16 08:09:16 +00:00
Felix Fietkau
40a7b55d70 unetmsg: only send publish notifications for remote publisher changes
handle_publish() notifies local subscribers about publisher state
changes. The publish/subscribe handler in network_socket_handle_request()
was calling it for both remote publish and subscribe changes, but
subscriber changes are not relevant to local subscribers.

Guard the handle_publish() calls with a msgtype == "publish" check,
matching the local client paths in unetmsgd-client.uc which already
have this guard.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit e0722d0ac4)
2026-02-16 08:09:16 +00:00
Felix Fietkau
41ec0c16a7 unetmsg: fix reconnect loop when RX authenticates before TX
When both peers connect simultaneously, the RX side can authenticate
before the TX handshake completes. network_check_auth() was sending a
ping on the unauthenticated TX channel, which gets rejected by the
remote's pre-auth handler as "Auth failed", killing the connection and
triggering an endless reconnect cycle.

Check chan.auth before interacting with the TX channel. If TX auth
hasn't completed yet, just schedule a reconnect timer - auth_data_cb
already handles state sync when TX auth completes.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 212040b5ca)
2026-02-16 08:09:16 +00:00
Felix Fietkau
69a4ca5e4a unetmsg: close all channels on network removal
network_close() only closed the listening socket without shutting down
established RX/TX connections. This left remote state in
core.remote_publish/core.remote_subscribe for hosts on the removed
network, causing stale entries in channel listings and failed routing
attempts.

Close all RX and TX channels before removing the network, which also
triggers remote state cleanup via network_rx_socket_close().

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 389a79d972)
2026-02-16 08:09:16 +00:00
Felix Fietkau
d63541ff98 unetmsg: fix inverted condition in network_rx_socket_close()
The cleanup condition checked != instead of ==, inverting the logic.
This caused two problems:

When an authenticated RX connection disconnected, remote state for that
host was never cleaned up since the stored entry matched the one being
closed.

When a stale unauthenticated connection from a peer closed, any existing
authenticated connection from the same peer was incorrectly deleted and
its remote state wiped.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit f09596f84f)
2026-02-16 08:09:16 +00:00
Felix Fietkau
ef79f65981 unetmsg: fix publish notification timing around remote auth
When a remote peer's publish registrations arrive via RX before the
local TX connection is authenticated, handle_publish fires but the
subscriber can't reach the remote publisher yet since the TX channel
isn't ready.

Suppress publish notifications on the RX side when no authenticated TX
channel exists for the remote host. After TX authentication completes,
re-trigger handle_publish only for topics that the specific peer
publishes and that have local subscribers.

Signed-off-by: John Crispin <john@phrozen.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 3efcf444a1)
2026-02-16 08:09:09 +00:00
Felix Fietkau
535403297e unetmsg: fix stale network cleanup in unetd_network_update()
The condition checked !data.networks instead of !data.networks[name],
making it always false since data.networks was already validated earlier
in the function. Networks removed from unetd were never closed.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit a2368e0f69)
2026-02-16 08:07:46 +00:00