Commit Graph

4396 Commits

Author SHA1 Message Date
David Bauer
76fabd909e wifi-scripts: don't fail on unset PSK
Don't fail wireless interface bringup on empty PSK set. This is a valid
configuration, resulting in a PSK network which can't be connected to.
It does not fail the bringup of the hostapd process.

Keep failing the interface setup in case a password with invalid length
is used.

This is also beneficial when intending to configure a PPSK network. It
allows to create a network where no PPSK is yet set.

Signed-off-by: David Bauer <mail@david-bauer.net>
Link: https://github.com/openwrt/openwrt/pull/17197
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-13 15:29:03 +01:00
Felix Fietkau
225b84d583 hostapd: fix building mini variants
Some checks are pending
Build all core packages / Build all core packages for selected target (push) Waiting to run
Move function and add ifdef to avoid undefined reference to hmac_sha256_kdf.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-13 11:04:48 +01:00
Felix Fietkau
b6c7d8a0d6 wifi-scripts: fix mesh/sta setup with ucode scripts
Ensure that the code doesn't pass macaddr_base with the wrong type (null)
to the supplicant setup/start call.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-13 10:57:18 +01:00
Andreas Gnau
a2f0cd35ac dropbear: Name pid file by uci section name
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Name the pidfile of each dropbear instance according to the
corresponding uci section name. This enables a 1:1 mapping between the
definition of the service instance and its process.

Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>

Link: https://github.com/openwrt/openwrt/pull/15177
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-12 20:02:38 +01:00
Sybil127
7306ae401c hostapd: add support for rxkh_file
Initial support for dynamic reload of RxKHs.

In order to check if RxKHs need reloading.
RxKHs defined in the rxkh_file first has to be parsed and formated,
the same way as hostapd will read from the file and also output,
with the command GET_RXKHS.
Then each list of RxKHs can be hashed and compared.

Ucode implementation of hostapds rkh_derive_key() function.
Hostapd converts hex keys with 128-bits or more when less than 256-bits
to 256-bits, and truncates those that are more than 256-bits.
See: https://w1.fi/cgit/hostap/commit/hostapd/config_file.c?id=245fc96e5f4b1c566b7eaa19180c774307ebed79

Signed-off-by: Sybil127 <sybil127@outlook.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-12 19:19:33 +01:00
Sybil127
97c8a94ec5 wifi-scripts: introduce rxkh_file uci option
With rxkh_file, hostapd will read a list of RxKHs from a text file.
This also makes it possible for hostapd to dynamically reload RxKHs.

RxKHs defined in rxkh_file should be formated as described in hostapd.conf,
with one entry per line.

R0KH/R1KH format:
r0kh=<MAC address> <NAS Identifier> <256-bit key as hex string>
r1kh=<MAC address> <R1KH-ID> <256-bit key as hex string>

Reworked behavior of the uci options r0kh and r1kh.

When rxkh_file is not configured:
  Instead of appending the RxKHs to the hostapd bss configuration.
  They will be added to a interface specific file with name
  /var/run/hostapd-phyX-apX.rxkh.
  This file will be used as the rxkh_file in the hostapd bss configuration.

When rxkh_file is configured:
  The specified file will be used in the hostapd bss configuration,
  and will be the only source for configured RxKHs.
  All RxKHs defined with the uci options r0kh or r1kh will be ignored.

Signed-off-by: Sybil127 <sybil127@outlook.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-12 19:19:05 +01:00
Felix Fietkau
00860e485b wifi-scripts: add macaddr_base wifi-device option
This can be used to configure the base mac address from which all
interface mac addresses are derived

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-12 19:19:05 +01:00
David Bauer
1be18c6daa wifi-scripts: fix failing mesh setup with missing wpa_supplicant
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
The initialization of mesh interfaces currently fail when wpa_supplicant
is not installed. This is due to the script calling the wpa_supplicant
feature indicator without verifying wpa_supplicant is installed at all.

To avoid failing, first check if wpa_supplicant is installed before
determining the available featureset.

Signed-off-by: David Bauer <mail@david-bauer.net>
2024-12-12 16:40:14 +01:00
Chuck R
36f309af05 dnsmasq: pass environment variables to hotplug
dnsmasq passes a limited amount of information via DHCP script arguments. Much
more information is available through environment variables starting with
DNSMASQ_, such as DNSMASQ_INTERFACE. However, when the dhcp-script builds its
JSON environment and passes it to hotplug, all of this information is discarded
since it is not copied to the JSON environment.

Personally, I have a custom-made set of DDNS scripts and rely on environment
variables such as DNSMASQ_INTERFACE in order to determine which DNS zones
to update. So, not being able to access these variables was detrimental to me.
I patched in a quick copy of all DNSMASQ_ variables to the JSON environment
so that they can be used in hotplug scripts. In order to do so I also copied
/usr/bin/env into dnsmasq's chroot jail.

Signed-off-by: Chuck R <github@chuck.cloud>

Link: https://github.com/openwrt/openwrt/pull/16354
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-12 11:00:38 +01:00
Leon M. Busch-George
821ebce8c1 mbim: sort config variables a little and fix minor bugs
Group 'local' declarations and 'json_get_vars', sort alphabetically within groups, and split off more generic parameters.

- delegate and sourcefilter were not declared as local variables

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>

Link: https://github.com/openwrt/openwrt/pull/16734
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-12 09:46:38 +01:00
Leon M. Busch-George
650410fca4 ncm: sort config variables a little and fix minor bugs
Group 'local' declarations and 'json_get_vars', sort alphabetically within groups, and split off more generic parameters.

- delegate and sourcefilter were not declared as local variables

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
2024-12-12 09:46:38 +01:00
Leon M. Busch-George
bf768867dc qmi: sort config variables a little and fix minor bugs
Group 'local' declarations and 'json_get_vars', sort alphabetically within groups, and split off more generic parameters.

- delegate and sourcefilter were not declared as local variables

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
2024-12-12 09:46:38 +01:00
Liangbin Lian
3710323a46 package/firewall: fix config typo
change Support-UDP-Traceroute rule from 'enabled false' to 'enabled 0'

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>

Link: https://github.com/openwrt/openwrt/pull/17133
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-12 09:46:38 +01:00
Rany Hany
65a1c666f2 hostapd: add SAE support for wifi-station and optimize PSK file creation
Regarding SAE support in wifi-station:

Important Note: Unlike PSK wifi-stations, both `mac` and `key` options are required
to make it work. With PSK, hostapd used to perform a brute-force match to find which
PSK entry to use, but with SAE this is infeasible due to SAE's design.

When `mac` is omitted, it will allow any MAC address to use the SAE password if it
didn't have a MAC address assigned to it, but this could only be done once.
The last wildcard entry would be used.

Also, unlike "hostapd: add support for SAE in PPSK option" (commit 913368a),
it is not required to set `sae_pwe` to `0`. This gives it a slight advantage
over using PPSK that goes beyond not needing RADIUS.

Example Configuration:

```
config wifi-vlan
        option iface default_radio0
        option name 999
        option vid 999
        option network management

config wifi-station
        # Allow user with MAC address 00:11:22:33:44:55 and matching
        # key "secretadminpass" to access the management network.
        option iface default_radio0
        option vid 999
        option mac '00:11:22:33:44:55'
        option key secretadminpass

config wifi-vlan
        option iface default_radio0
        option name 100
        option vid 100
        option network guest

config wifi-station
        # With SAE, when 'mac' is omitted it will be the fallback in case no
        # other MAC address matches. It won't be possible for a user that
        # has a matching MAC to use this network (i.e., 00:11:22:33:44:55
        # in this example).
        option iface default_radio0
        option vid 100
        option key guestpass
```

Regarding PSK file creation optimization:

This patch now conditionally runs `hostapd_set_psk_file` depending on `auth_type`.
Previously, `hostapd_set_psk` would always execute `hostapd_set_psk_file`, which
would create a new file if `wifi-station` was in use even if PSK was not enabled.
This change checks the `auth_type` to ensure that it is appropriate to parse the
`wifi-station` entries and create those files.

Furthermore, we now only configure `wpa_psk_file` when it is a supported option
(i.e., psk or psk-sae is used). Previously, we used to configure it when it was
not necessary. While it didn't cause any issues, it would litter `/var/run` with
unnecessary files. This patch fixes that case by configuring it depending on the
`auth_type`.

The new SAE support is aligned with these PSK file changes.

Signed-off-by: Rany Hany <rany_hany@riseup.net>

Link: https://github.com/openwrt/openwrt/pull/17145
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-12 09:46:38 +01:00
John Crispin
d162fd5ed4 umdns: update to latest HEAD
93458ac dns: fix response to TYPE_PTR query
68af311 fix unicast response port and timeout
a2b4979 service: announce all services in single dns answer
4537734 display announced services in ubus call umdns browse
0b50c29 display more srv attributes in output of ubus browse function

Signed-off-by: John Crispin <john@phrozen.org>
2024-12-11 15:41:21 +01:00
John Crispin
60f9ec2b22 wifi-scripts: ucode: change default behaviour of the vlan_no_bridge option
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-11 14:43:25 +01:00
John Crispin
3dd1c476d9 wifi-scripts: ucode: remove debug code
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-11 12:28:43 +01:00
John Crispin
7e854bd943 wifi-scripts: ucode: append global options on STA interfaces
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-11 12:28:43 +01:00
John Crispin
3ab1a69339 wifi-scripts: ucode: fix parsing of legacy hwmode option
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-11 12:28:43 +01:00
John Crispin
4c60fba3d8 wifi-scripts: ucode: only set mbssid on ax and be radios
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-11 12:28:43 +01:00
John Crispin
5bc82dede0 wifi-scripts: ucode: typo fix
Signed-off-by: John Crispin <john@phrozen.org>
2024-12-11 11:57:42 +01:00
Robert Marko
ff5f77ecdd iproute2: update to 6.12.0
Release Notes:
https://lore.kernel.org/netdev/20241119092743.6a1bdcb7@hermes.local/T/

Allows us to drop 2 upstreamed patches:
package/network/utils/iproute2/patches/010-bridge-mst-fix-a-musl-build-issue.patch
package/network/utils/iproute2/patches/011-bridge-mst-fix-a-further-musl-build-issue.patch

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Link: https://github.com/openwrt/openwrt/pull/17206
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-10 11:40:57 +01:00
Felix Fietkau
59dd9cddf9 hostapd: fix processing mbssid config option
Do not strip the first character from the field name

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-09 20:10:43 +01:00
Eric Long
3d8d81883f bpftool: turn off libbfd feature in host build
libbfd feature is not used when building eBPF program, and it makes bpftool fail to build in a clean environment, since binutils in toolchain have libbfd disabled.

Signed-off-by: Eric Long <i@hack3r.moe>
Link: https://github.com/openwrt/openwrt/pull/17073
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-09 11:21:06 +01:00
Felix Fietkau
cf1909a024 wifi-scripts: fix channels array property parsing in ucode script
Since the channels array can contain ranges, its type needs to be string, not number.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-08 15:11:28 +01:00
Felix Fietkau
ed34e337a9 wifi-scripts: fix ucode support for referencing wifi devices by phy name
Rename phys according to board.json

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-08 14:11:14 +01:00
Felix Fietkau
0286dfe394 wifi-scripts: fix regression with ucode update
nl80211.request with GET_WIPHY for a single wiphy no longer returns an array

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-08 14:11:14 +01:00
Felix Fietkau
1aa2695620 wifi-scripts: fix roaming setup with ucode scripts
- fix variable references for ft key
- add r0kh and r1kh if ft_generate_local is not set (logic inversion bug)

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-05 15:08:23 +01:00
Robert Marko
d92d14c64c hostapd: enable EAP-pwd support only for the SSL variants
The internal hostapd version cannot be built with EAP-pwd support, so
enable it only for the SSL variants.

Fixes: #17163
Fixes: 6365316fab ("hostapd: add ubus support for wired driver")
Link: https://github.com/openwrt/openwrt/pull/17164
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-04 17:20:44 +01:00
Felix Fietkau
a9ff3ba24b wifi-scripts: add option to set per-device ifname prefix
Simplifies setting ifname to a different pattern for all affected
interfaces.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-04 14:59:30 +01:00
Felix Fietkau
d127539291 wifi-scripts: remove leftover legacy (non-netifd) wifi script support
cfg80211 is the only supported wireless API

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-12-04 14:53:45 +01:00
John Crispin
3ba6737f2f wifi-scripts: various minor fixes to the new ucode scripts
* cosmetic clean up
* properly import the digest module
* typo fixes

Signed-off-by: John Crispin <john@phrozen.org>
2024-12-03 14:26:41 +01:00
John Crispin
218f3884d2 wifi-scripts: add ucode based scripts
Add an ucode based re-implementation of the shell script based wifi code.

The new code is jsonschema driven. The code has been refactored into several
files making it easier to follow.

The new scripts are also way faster than the previous sh implementation.

The new code is currently opt-in via WIFI_SCRIPTS_UCODE and defaults to
EXPERIMENTAL.

Signed-off-by: John Crispin <john@phrozen.org>
2024-12-02 13:55:36 +01:00
John Crispin
0210279888 wifi-scripts: add ucode based iwinfo
Add an ucode based re-implementation of iwinfo. The tool behaves like the old
one with a few minor output differences. It is now possible to add -j to any
command resulting in JSON output.

The new code is currently opt-in via WIFI_SCRIPTS_UCODE and defaults to
EXPERIMENTAL.

Signed-off-by: John Crispin <john@phrozen.org>
2024-12-02 13:55:36 +01:00
John Crispin
304fd40592 hostapd: expose owe_transition_ifname inside bss_info method
This allows iwinfo to match OWE interfaces.

Signed-off-by: John Crispin <john@phrozen.org>
2024-12-02 13:55:36 +01:00
John Crispin
6365316fab hostapd: add ubus support for wired driver
Use and alternate ubus object when the config contains "driver=wired". This
commit is in preparation of the ieee8021x-wired daemon.

Signed-off-by: John Crispin <john@phrozen.org>
2024-12-02 13:55:36 +01:00
John Crispin
461d9dca89 hostapd: add radius WISPr rate control AVPs
This allows a radius server to send AVPs for client rate control inside the
accept message. Further add the ratelimits to the sta-authorized ubus
notification.

Signed-off-by: John Crispin <john@phrozen.org>
2024-12-02 13:55:36 +01:00
John Crispin
90d0065f51 hostapd: enable CONFIG_EAP_PSK
Without this option using the eap_server in combination with wifi-station
entries will fail.

Signed-off-by: John Crispin <john@phrozen.org>
2024-12-02 13:55:36 +01:00
Andris PE
207bfee855 netifd: check if /sbin/wifi exists before calling it
Avoid harmless error from network script by checking presence of
now-optional wifi support script, most notably confusing users of x86
snapshots.

Fixes: #14964
Signed-off-by: Andris PE <neandris@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/14986
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-11-30 19:23:29 +01:00
Paul Donald
f4492b6b1c
netifd: update to Git 768027c5a7640137857f412f554227abd6160cdd (2024-11-27)
86da5cbcdb9d system-linux: do not pull ifindex/flags from netlink messages on rtnl events
cd96f61ba63e proto-shell: fix spurious interface teardowns with host deps
a39fe3a8b150 wireless: add support for adding a list of devices for a wifi-iface
d29cf707478c iprule: add ipproto property
768027c5a764 system-linux: restore reading flags from netlink messages

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17074
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2024-11-27 21:34:08 +00:00
Hauke Mehrtens
a9d3c5b4c9 dropbear: bump to 2024.86
- update dropbear to latest stable 2024.86;
  for the changes see https://matt.ucc.asn.au/dropbear/CHANGES

Link: https://github.com/openwrt/openwrt/pull/17053
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-24 20:08:12 +01:00
Hauke Mehrtens
adf958c919 wifi-scripts: Fix parsing of Capabilities
Fixup capabilities parsing in iw output.

In addition to the normal capabilities iw now also outputs HE MAC, HE
PHY and EHT MAC and EHT PHY capabilities. Exclude them in the parsing.

The grep returns this with mac80211-hwsim:
```
root@OpenWrt:~# iw phy phy0 info | grep 'Capabilities:'
		Capabilities: 0x107e
			HE PHY Capabilities: (0x02bfce0000000000000000):
			EHT PHY Capabilities: (0x7c0000feffff7f01):
			HE PHY Capabilities: (0x02bfce0000000000000000):
			EHT PHY Capabilities: (0x7c0000feffff7f01):
			HE PHY Capabilities: (0x02bf000000000000000000):
		Capabilities: 0x107e
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfc1f3ffeffff7f37):
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfc1f3ffeffff7f37):
			HE PHY Capabilities: (0x1cbf000000000000000000):
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfefffffeffffff7f):
			HE PHY Capabilities: (0x1cbfce0000000000000000):
			EHT PHY Capabilities: (0xfefffffeffffff7f):
			HE PHY Capabilities: (0x1cbf000000000000000000):
		Capabilities: 0x107e
```

With busybox 1.36.1 the ht_cap_mask variable will be set to
-72057598332895361. With busybox 1.37.0 it will be set to -1.
Both values are wrong, after this change it will be set to 4222
(0x107E).

Link: https://github.com/openwrt/openwrt/pull/17043
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-23 14:01:38 +01:00
He Ping
b0312c1081
odhcp6c: update to Git HEAD (2024-09-25)
b6ae9ffaeb0e odhcp6c: allow to request specific ipv6 prefix

Signed-off-by: He Ping <pinghejk@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17013
Signed-off-by: Petr Štetiar <ynezz@true.cz> [hash, commit]
2024-11-19 08:03:42 +00:00
Sergey Ponomarev
4511fa4b30 dropbear: use config_get_bool enable
The config_get_bool also works with on/off, yes/no, true/false.
Add 'main' section name. This will make it easier to change settings from uci.
Add a link to documentation.

Signed-off-by: Sergey Ponomarev <stokito@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15579
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-17 16:41:48 +01:00
Shiji Yang
3dbe730080
ppp: remove more unnecessary kernel checks
The ppp package can support all features since Linux 4.7.0 kernel.
Therefore, most kernel version checks can pass unconditionally on
OpenWrt v18.06 and later version. This patch can reduce the size
of ppp package by approximately 2.5 KB.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16695
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-11-16 14:26:47 +01:00
Hauke Mehrtens
c11a18be0d nftables: update to 1.1.1
Release Announcement:
https://lwn.net/Articles/982283/
https://lwn.net/Articles/992760/

Link: https://github.com/openwrt/openwrt/pull/16769
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-11-11 00:05:06 +01:00
Leon M. Busch-George
8b6d5874b8
hostapd: split long lines
These two were getting rather long.

Signed-off-by: Leon M. Busch-George <leon@georgemail.eu>
Link: https://github.com/openwrt/openwrt/pull/16849
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-11-10 02:15:56 +01:00
Felix Fietkau
5f68e24333 netifd: update to Git HEAD (2024-11-08)
e93f6c3fc729 main: fix format string related warnings for log/debug printf functions
6ab44a2413f9 fix signed/unsigned comparison warnings
4fe997b61d7d system-dummy: add system_if_apply_settings_after_up
992d33cb42a6 ubus: add notifications on wireless device state changes
34eb11eb6f5c device/interface: add "tags" attribute from config to status dump

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-11-08 10:51:00 +01:00
Felix Fietkau
a3ec35cadb wifi-scripts: add free-form "tags" array option for wifi-iface
This allows annotating wifi interfaces in the config in a way that can be
queried through wifi status. One example use case is to mark wifi interfaces
for use with specific services without having to explicitly reference the
(often unnamed) sections from elsewhere.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-11-08 10:51:00 +01:00
Christian Marangi
c8955268bc
adb-enablemodem: fix version for APK
Refactor version of adb-enablemodem for APK.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-29 00:07:53 +01:00