From 11beb822a5aabdbef35465a533e1da540fdd074d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 5 Jun 2020 22:20:22 +0200 Subject: [PATCH 01/20] build: target_config_check: make check more lenient Always allow options set to builtin (=y) when modular setting (=m) is expected. This can happen when a package is added explicitly (in a target defintion or site.mk) that is also pulled in as a dependency of another builtin package. Fixes: 9e23534ec365 ("build: rework config generation") Fixes: #2046 (cherry picked from commit 8b64517f1b3c4e46d2080c312243f96a6ac03366) --- scripts/target_config_check.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/target_config_check.lua b/scripts/target_config_check.lua index 9be50585..373a650e 100755 --- a/scripts/target_config_check.lua +++ b/scripts/target_config_check.lua @@ -9,18 +9,26 @@ local function fail(msg) io.stderr:write(' * ', msg, '\n') end -local function match_config(f) - for line in io.lines('openwrt/.config') do - if f(line) then - return true - end +local function match_config(expected, actual) + if expected == actual then + return true + end + + if expected:gsub('=m$', '=y') == actual then + return true end return false end local function check_config(config) - return match_config(function(line) return line == config end) + for line in io.lines('openwrt/.config') do + if match_config(config, line) then + return true + end + end + + return false end From 8ecc5d89cc5a43e7f1a121a5658ba72871184832 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 6 Jun 2020 15:42:24 +0200 Subject: [PATCH 02/20] gluon-config-mode-outdoor, gluon-web-wifi-config: commit network config 200-wireless will add or remove the mesh network sections of /etc/config/network. Commit this file, so the modified setting doesn't get lost on reboot. Fixes: #2048 (cherry picked from commit 600ab99f809d78d6281ad999e7e4e4a91322a85c) --- .../luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua | 2 +- .../luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua b/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua index c36c1f8f..3f1f0cbe 100644 --- a/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua +++ b/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua @@ -25,5 +25,5 @@ return function(form, uci) end end - return {'gluon', 'wireless'} + return {'gluon', 'network', 'wireless'} end diff --git a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua index 32cdc249..ba662d20 100644 --- a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua +++ b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua @@ -181,6 +181,7 @@ end function f:write() uci:commit('gluon') os.execute('/lib/gluon/upgrade/200-wireless') + uci:commit('network') uci:commit('wireless') end From 63ca8f8bfa79a78e3c7c341a2a7979684602d8de Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 6 Jun 2020 16:48:26 +0200 Subject: [PATCH 03/20] gluon-web-wifi-config: rename and simplify filter_active_interfaces() - Return early - Rename to has_active_interfaces(), as it returns a boolean (cherry picked from commit 53c33acaf96e2294fe299511f3db2c9894462395) --- .../lib/gluon/config-mode/model/admin/wifi-config.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua index ba662d20..d8de670a 100644 --- a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua +++ b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua @@ -71,14 +71,13 @@ uci:foreach('wireless', 'wifi-device', function(config) return out end - local function filter_active_interfaces(interfaces) - local out = false + local function has_active_interfaces(interfaces) for _, interface in ipairs(interfaces) do if not uci:get_bool('wireless', interface .. '_' .. radio, 'disabled') then - out = true + return true end end - return out + return false end local function vif_option(name, interfaces, msg) @@ -89,7 +88,7 @@ uci:foreach('wireless', 'wifi-device', function(config) end local o = p:option(Flag, radio .. '_' .. name .. '_enabled', msg) - o.default = filter_active_interfaces(existing_interfaces) + o.default = has_active_interfaces(existing_interfaces) function o:write(data) for _, interface in ipairs(existing_interfaces) do From 3d091912af4130752cdf5f806ed2d605434886fe Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 6 Jun 2020 16:58:00 +0200 Subject: [PATCH 04/20] gluon-web-wifi-config: make mesh VIF options depend on outdoor=false Instead of relying on the existence of interface sections only (which is still used for the case of interface types that are not configured at all in the site config), add a proper dependency. This fixes section visiblity with enabled outdoor mode after the following fix, and gives the user immediate feedback (allowing to disable outdoor mode and enable meshing in a single step). (cherry picked from commit d012d7d32fa5235fd260efab64142005f8d36c2f) --- .../config-mode/model/admin/wifi-config.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua index d8de670a..98501bd8 100644 --- a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua +++ b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua @@ -47,13 +47,18 @@ f:section(Section, nil, translate( )) +local mesh_vifs_5ghz = {} + + uci:foreach('wireless', 'wifi-device', function(config) local radio = config['.name'] + local is_5ghz = false local title if config.hwmode == '11g' or config.hwmode == '11ng' then title = translate("2.4GHz WLAN") elseif config.hwmode == '11a' or config.hwmode == '11na' then + is_5ghz = true title = translate("5GHz WLAN") else return @@ -95,10 +100,16 @@ uci:foreach('wireless', 'wifi-device', function(config) uci:set('wireless', interface .. '_' .. radio, 'disabled', not data) end end + + return o end vif_option('client', {'client', 'owe'}, translate('Enable client network (access point)')) - vif_option('mesh', {'mesh'}, translate("Enable mesh network (802.11s)")) + + local mesh_vif = vif_option('mesh', {'mesh'}, translate("Enable mesh network (802.11s)")) + if is_5ghz then + table.insert(mesh_vifs_5ghz, mesh_vif) + end local phy = wireless.find_phy(config) if not phy then @@ -142,6 +153,10 @@ if has_5ghz_radio() then local outdoor = r:option(Flag, 'outdoor', translate("Node will be installed outdoors")) outdoor.default = uci:get_bool('gluon', 'wireless', 'outdoor') + for _, mesh_vif in ipairs(mesh_vifs_5ghz) do + mesh_vif:depends(outdoor, false) + end + function outdoor:write(data) uci:set('gluon', 'wireless', 'outdoor', data) end From e6491287ba02d3b5b2f30772c0516f9d22b6cd71 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 6 Jun 2020 16:30:38 +0200 Subject: [PATCH 05/20] gluon-core: create disabled mesh interface sections in outdoor mode The interfaces should always exist and just be disabled when outdoor mode is enabled. Not creating them at all leads to an issue in the advanced wifi settings where an additional reload of the page is necessary after enabling or disabling the ourdoor mode to make the mesh VIF options appear or disappear. (cherry picked from commit b15b008e6951084531b69583076931be844fe075) --- package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless index 5cc43f68..f72908a2 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless @@ -162,12 +162,13 @@ local function fixup_wan(radio, index) uci:set('wireless', name, 'macaddr', macaddr) end -local function configure_mesh_wireless(radio, index, config) +local function configure_mesh_wireless(radio, index, config, disabled) local radio_name = radio['.name'] local suffix = radio_name:match('^radio(%d+)$') configure_mesh(config.mesh(), radio, index, suffix, first_non_nil( + disabled, is_disabled('mesh_' .. radio_name), config.mesh.disabled(false) ) @@ -215,7 +216,7 @@ wireless.foreach_radio(uci, function(radio, index, config) util.add_to_set(hostapd_options, 'country3=0x4f') uci:set_list('wireless', radio_name, 'hostapd_options', hostapd_options) - uci:delete('wireless', 'mesh_' .. radio_name) + configure_mesh_wireless(radio, index, config, true) else uci:delete('wireless', radio_name, 'channels') From 41d13742f6eb79a6b4372dce1d4afcfbe89e3805 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 11 Jun 2020 02:16:49 +0200 Subject: [PATCH 06/20] build: target_config_lib: do not build unused packages for targets without opkg (#2051) Normally, we build all nonshared packages (which includes all kernel modules) to generate an opkg feed for later package installations by users. On targets without opkg, this just wastes time - disable it. (cherry picked from commit b3edfd292a15ad34abb08236bdca231d7a6c3d52) --- scripts/target_config_lib.lua | 1 + targets/generic | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/target_config_lib.lua b/scripts/target_config_lib.lua index fc897d68..346a18a7 100644 --- a/scripts/target_config_lib.lua +++ b/scripts/target_config_lib.lua @@ -139,6 +139,7 @@ lib.check_devices() if not lib.opkg then lib.config('SIGNED_PACKAGES', false) lib.config('CLEAN_IPKG', true) + lib.config('ALL_NONSHARED', false) lib.packages {'-opkg'} end diff --git a/targets/generic b/targets/generic index c7f28452..89aba6f2 100644 --- a/targets/generic +++ b/targets/generic @@ -40,7 +40,7 @@ config('PACKAGE_kmod-jool', false) -- fails to build config('BUSYBOX_CUSTOM', true) config('BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS', false) -config('PACKAGE_ATH_DEBUG', true) +try_config('PACKAGE_ATH_DEBUG', true) try_config('TARGET_SQUASHFS_BLOCK_SIZE', 256) From 86b0a60d8d042aff1d6f3bf2834dcd8182b929a2 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 11 Jun 2020 23:52:22 +0200 Subject: [PATCH 07/20] gluon-core: fix handling of 'disabled' site.conf attributes for mesh interfaces Because is_disabled() was always returning true or false, the first_non_nil() would never actually check the default setting from site.conf. This was broken since v2017.1. Fixes: 6cf03bab37f9 ("treewide: replace normal uses of luci.model.uci with simple-uci to reduce LuCI dependencies") (cherry picked from commit 3c2593b68436479d10cfa09def81b6f8b6e3546b) --- package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless index f72908a2..073d0694 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless @@ -85,7 +85,7 @@ local function is_disabled(name) if uci:get('wireless', name) then return uci:get_bool('wireless', name, 'disabled') else - return false + return nil end end From b466d00d3fed526da9972d4d6e70f07d7979431f Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 12 Jun 2020 00:02:15 +0200 Subject: [PATCH 08/20] gluon-web-wifi-config: default to enabled 5GHz mesh interfaces when disabling outdoor mode When disabling outdoor mode, 5GHz mesh interfaces should be enabled by default again (unless disabled in site.conf). (cherry picked from commit d2052431dd4ab4c1c5e0ce406219e281df297715) --- .../luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua index 98501bd8..efc6d0f0 100644 --- a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua +++ b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua @@ -1,5 +1,6 @@ local iwinfo = require 'iwinfo' local uci = require("simple-uci").cursor() +local site = require 'gluon.site' local wireless = require 'gluon.wireless' @@ -155,6 +156,9 @@ if has_5ghz_radio() then for _, mesh_vif in ipairs(mesh_vifs_5ghz) do mesh_vif:depends(outdoor, false) + if outdoor.default then + mesh_vif.default = not site.wifi5.mesh.disabled(false) + end end function outdoor:write(data) From ee473ce2a4491a4c6317db676ef2087d24e24268 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 12 Jun 2020 00:12:24 +0200 Subject: [PATCH 09/20] gluon-config-mode-outdoor: enable 5GHz mesh interfaces when disabling outdoor mode There is no setting to explicitly enable mesh interfaces in the config wizard, so we need to enable mesh interfaces by default when the outdoor mode is disabled (unless site.conf dictates otherwise). The simplest way to achieve this is to delete the 5GHz mesh interface sections when outdoor mode is disabled: 200-wireless would delete and recreate them a moment later anyways, but by deleting them earlier we ensure that the disabled status is initialized from site.conf again. (cherry picked from commit 17bc6228929b38356d4209af64f807432daf713b) --- .../gluon/config-mode/wizard/0250-outdoor.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua b/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua index 3f1f0cbe..ffa030dd 100644 --- a/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua +++ b/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua @@ -21,6 +21,24 @@ return function(form, uci) if data ~= outdoor_mode then uci:set('gluon', 'wireless', 'outdoor', data) uci:save('gluon') + + if data == false then + local mesh_ifaces_5ghz = {} + uci:foreach('wireless', 'wifi-device', function(config) + if config.hwmode ~= '11a' and config.hwmode ~= '11na' then + return + end + + local radio_name = config['.name'] + local mesh_iface = 'mesh_' .. radio_name + table.insert(mesh_ifaces_5ghz, mesh_iface) + end) + for _, mesh_iface in ipairs(mesh_ifaces_5ghz) do + uci:delete('wireless', mesh_iface) + end + uci:save('wireless') + end + os.execute('/lib/gluon/upgrade/200-wireless') end end From 3926717998bca572511bf7baa1a98090d983d2c3 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 13 Jun 2020 18:44:46 +0200 Subject: [PATCH 10/20] gluon-mesh-batman-adv: do not delete bat0 during hardif teardown (#2057) With very bad timing, it is possible that the teardown script of a gluon_mesh interface runs when bat0 was just created, but primary0 is not yet added to it. Although there is no hardif to remove in this case, bat0 will still be deleted, because there is no hardif in bat0. Disable the interface removal logic by passing `-M` to `batctl interface`. (cherry picked from commit 92647cd47a32ed432cf4e82685245b20bad1248c) --- .../lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv b/package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv index a8850f18..d74b1bf7 100755 --- a/package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv +++ b/package/gluon-mesh-batman-adv/files/lib/gluon/core/mesh/teardown.d/70-gluon-mesh-batman-adv @@ -1,5 +1,5 @@ #!/bin/sh lock /var/lock/gluon_bat0.lock -batctl interface del "$IFNAME" 2>/dev/null +batctl interface -M del "$IFNAME" 2>/dev/null lock -u /var/lock/gluon_bat0.lock From f9008851d5ffed252b4e9cfd5af2c5c48c2c6ab2 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 10 Jun 2020 22:41:01 +0200 Subject: [PATCH 11/20] mac80211: rt2800: enable MFP support unconditionally This gives us WPA3 support out of the box without having to manually disable hardware crypto. The driver will fall back to software crypto if the connection requires management frame protection. THis allows us to use WPA3 features (Private-WiFi SAE & OWE) on ramips-mt7620. --- ...0-enable-MFP-support-unconditionally.patch | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 patches/openwrt/0012-mac80211-rt2800-enable-MFP-support-unconditionally.patch diff --git a/patches/openwrt/0012-mac80211-rt2800-enable-MFP-support-unconditionally.patch b/patches/openwrt/0012-mac80211-rt2800-enable-MFP-support-unconditionally.patch new file mode 100644 index 00000000..0a8ca213 --- /dev/null +++ b/patches/openwrt/0012-mac80211-rt2800-enable-MFP-support-unconditionally.patch @@ -0,0 +1,62 @@ +From: Rui Salvaterra +Date: Mon, 25 May 2020 14:49:07 +0100 +Subject: mac80211: rt2800: enable MFP support unconditionally + +This gives us WPA3 support out of the box without having to manually disable +hardware crypto. The driver will fall back to software crypto if the connection +requires management frame protection. + +Signed-off-by: Daniel Golle +[apply to openwrt-1907] +Signed-off-by: David Bauer + +diff --git a/package/kernel/mac80211/patches/rt2x00/080-rt2800-enable-MFP-support-unconditionally.patch b/package/kernel/mac80211/patches/rt2x00/080-rt2800-enable-MFP-support-unconditionally.patch +new file mode 100644 +index 0000000000000000000000000000000000000000..1d55b2756c365a13b2315e874809e2397fb35855 +--- /dev/null ++++ b/package/kernel/mac80211/patches/rt2x00/080-rt2800-enable-MFP-support-unconditionally.patch +@@ -0,0 +1,44 @@ ++From b6b15e20421fefae9f78274f9fef80bc97bf5d5c Mon Sep 17 00:00:00 2001 ++From: Rui Salvaterra ++Date: Mon, 25 May 2020 14:49:07 +0100 ++Subject: [PATCH] rt2800: enable MFP support unconditionally ++ ++This gives us WPA3 support out of the box without having to manually disable ++hardware crypto. The driver will fall back to software crypto if the connection ++requires management frame protection. ++ ++Suggested-by: Stanislaw Gruszka ++Signed-off-by: Rui Salvaterra ++Acked-by: Stanislaw Gruszka ++Signed-off-by: Kalle Valo ++Link: https://lore.kernel.org/r/20200525134906.1672-1-rsalvaterra@gmail.com ++--- ++ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 +--- ++ drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 3 ++- ++ 2 files changed, 3 insertions(+), 4 deletions(-) ++ ++--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++@@ -9985,9 +9985,7 @@ static int rt2800_probe_hw_mode(struct r ++ if (!rt2x00_is_usb(rt2x00dev)) ++ ieee80211_hw_set(rt2x00dev->hw, HOST_BROADCAST_PS_BUFFERING); ++ ++- /* Set MFP if HW crypto is disabled. */ ++- if (rt2800_hwcrypt_disabled(rt2x00dev)) ++- ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE); +++ ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE); ++ ++ SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); ++ SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, ++--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c +++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c ++@@ -459,7 +459,8 @@ int rt2x00mac_set_key(struct ieee80211_h ++ if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) ++ return 0; ++ ++- if (!rt2x00_has_cap_hw_crypto(rt2x00dev)) +++ /* The hardware can't do MFP */ +++ if (!rt2x00_has_cap_hw_crypto(rt2x00dev) || (sta && sta->mfp)) ++ return -EOPNOTSUPP; ++ ++ /* From efb6b9d555bc31257f5fd16826919c53d7473570 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 10 Jun 2020 22:44:58 +0200 Subject: [PATCH 12/20] gluon-core: allow WPA3 features on ramips-mt7620 Backporting the MFP patch allows us to utilize WPA3 features on this target. Tested on TP-Link Archer C20i --- package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua index b4fc708b..213eb150 100644 --- a/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua +++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua @@ -66,7 +66,7 @@ end function M.device_supports_wpa3() -- rt2x00 crashes when enabling WPA3 personal / OWE VAP - if M.match('ramips', 'rt305x') or M.match('ramips', 'mt7620') then + if M.match('ramips', 'rt305x') then return false end From 5696be7240ba351f662b5b2ad076d6210cede58f Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 13 Jun 2020 20:08:13 +0200 Subject: [PATCH 13/20] mt76: mt76x0: disable GTK offloading When the GTK is offloaded, MT7610 won't transmit any multicast frames. This is most likely due to a bug in the offloading datapath. MT7612 is not affected. Disable GTK offloading for now. It can be re-enabled once the bug in the offloading path is fixed. Signed-off-by: David Bauer --- ...3-mt76-mt76x0-disable-GTK-offloading.patch | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 patches/openwrt/0013-mt76-mt76x0-disable-GTK-offloading.patch diff --git a/patches/openwrt/0013-mt76-mt76x0-disable-GTK-offloading.patch b/patches/openwrt/0013-mt76-mt76x0-disable-GTK-offloading.patch new file mode 100644 index 00000000..c1f404c8 --- /dev/null +++ b/patches/openwrt/0013-mt76-mt76x0-disable-GTK-offloading.patch @@ -0,0 +1,49 @@ +From: David Bauer +Date: Sat, 13 Jun 2020 19:19:17 +0200 +Subject: mt76: mt76x0: disable GTK offloading + +When the GTK is offloaded, MT7610 won't transmit any multicast frames. +This is most likely due to a bug in the offloading datapath. MT7612 is +not affected. + +Disable GTK offloading for now. It can be re-enabled once the bug in the +offloading path is fixed. + +Signed-off-by: David Bauer + +diff --git a/package/kernel/mt76/patches/001-mt76-mt76x0-disable-gtk-offloading.patch b/package/kernel/mt76/patches/001-mt76-mt76x0-disable-gtk-offloading.patch +new file mode 100644 +index 0000000000000000000000000000000000000000..e7e19ac957dbfaa9510016d3387abe9eed353538 +--- /dev/null ++++ b/package/kernel/mt76/patches/001-mt76-mt76x0-disable-gtk-offloading.patch +@@ -0,0 +1,30 @@ ++From ae01717951013fbc8bb0315d902d5b9f5873631a Mon Sep 17 00:00:00 2001 ++From: David Bauer ++Date: Fri, 12 Jun 2020 01:09:57 +0200 ++Subject: [PATCH] mt76: mt76x0: disable GTK offloading ++ ++When the GTK is offloaded, MT7610 won't transmit any multicast frames. ++This is most likely due to a bug in the offloading datapath. MT7612 is ++not affected. ++ ++Disable GTK offloading for now. It can be re-enabled once the bug in the ++offloading path is fixed. ++ ++Signed-off-by: David Bauer ++--- ++ drivers/net/wireless/mediatek/mt76/mt76x02_util.c | 4 ++++ ++ 1 file changed, 4 insertions(+) ++ ++--- a/mt76x02_util.c +++++ b/mt76x02_util.c ++@@ -432,6 +432,10 @@ int mt76x02_set_key(struct ieee80211_hw ++ !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) ++ return -EOPNOTSUPP; ++ +++ /* MT76x0 GTK offloading is currently broken */ +++ if (is_mt76x0(dev) && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) +++ return -EOPNOTSUPP; +++ ++ /* ++ * In USB AP mode, broadcast/multicast frames are setup in beacon ++ * data registers and sent via HW beacons engine, they require to From 12f90e3a57fc8f365eee88c0a202819b4e995285 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Mon, 6 Jul 2020 20:06:52 +0200 Subject: [PATCH 14/20] docs: wlan-configuration: document outdoor mode behavior (#2075) Document the behavior of the Outdoor mode when preserve_channels is enabled. --- docs/features/wlan-configuration.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/features/wlan-configuration.rst b/docs/features/wlan-configuration.rst index 3807b889..08528196 100644 --- a/docs/features/wlan-configuration.rst +++ b/docs/features/wlan-configuration.rst @@ -21,4 +21,6 @@ you can configure this via the uci section ``gluon-core.wireless``:: uci set gluon-core.@wireless[0].preserve_channels='1' +When channels should be preserved, toggling the outdoor mode will have no effect on the channel settings. +Therefore, the Outdoor mode settings won't be displayed in config mode. Keep in mind that nodes running wifi interfaces on custom channels can't mesh with default nodes anymore! From bc066b88e62e80d9456bced0d7272230a5f38229 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jul 2020 00:10:29 +0200 Subject: [PATCH 15/20] gluon-radv-filterd: remove unneeded memset (cherry picked from commit e384f899b70e3b84d8ba94bd63f26c67c72d8788) --- package/gluon-radv-filterd/src/gluon-radv-filterd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/gluon-radv-filterd/src/gluon-radv-filterd.c b/package/gluon-radv-filterd/src/gluon-radv-filterd.c index ed090c46..e411d8bf 100644 --- a/package/gluon-radv-filterd/src/gluon-radv-filterd.c +++ b/package/gluon-radv-filterd/src/gluon-radv-filterd.c @@ -559,14 +559,13 @@ static int parse_tt_local(struct nl_msg *msg, } static void update_tqs(void) { + static const struct ether_addr unspec = {}; struct router *router; bool update_originators = false; - struct ether_addr unspec; struct batadv_nlquery_opts opts; int ret; // reset TQs - memset(&unspec, 0, sizeof(unspec)); foreach(router, G.routers) { router->tq = 0; if (ether_addr_equal(router->originator, unspec)) From ce6caa1ac7bc06cda03ce9aa969d7bcbd830d137 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jul 2020 00:10:45 +0200 Subject: [PATCH 16/20] gluon-radv-filterd: downgrade frequent messages to DEBUG_MSG When the network connectivity is bad, routers may not appear in the translation tables, or there may be no originator with TQ >0. Such conditions to not warrant spamming the log with error messages. (cherry picked from commit fcd07de6767e9cba392cd2a30b4579b6a7cc0d21) --- package/gluon-radv-filterd/src/gluon-radv-filterd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/gluon-radv-filterd/src/gluon-radv-filterd.c b/package/gluon-radv-filterd/src/gluon-radv-filterd.c index e411d8bf..b1620cae 100644 --- a/package/gluon-radv-filterd/src/gluon-radv-filterd.c +++ b/package/gluon-radv-filterd/src/gluon-radv-filterd.c @@ -608,12 +608,12 @@ static void update_tqs(void) { foreach(router, G.routers) { if (router->tq == 0) { if (ether_addr_equal(router->originator, unspec)) - fprintf(stderr, - "Unable to find router " F_MAC " in transtable_{global,local}\n", + DEBUG_MSG( + "Unable to find router " F_MAC " in transtable_{global,local}", F_MAC_VAR(router->src)); else - fprintf(stderr, - "Unable to find TQ for originator " F_MAC " (router " F_MAC ")\n", + DEBUG_MSG( + "Unable to find TQ for originator " F_MAC " (router " F_MAC ")", F_MAC_VAR(router->originator), F_MAC_VAR(router->src)); } From d3613ac5df57b9cb5da55225e99f15ee6884e43c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 2 Jul 2020 00:16:36 +0200 Subject: [PATCH 17/20] gluon-radv-filterd: add string.h and guard to mac.h - #pragma once include guard - include string.h to get memset and memcmp prototypes to fix respondd provider build warning (cherry picked from commit e32fa5bc6454813f8bb9e82d91accd7b426e33c5) --- package/gluon-radv-filterd/src/mac.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/gluon-radv-filterd/src/mac.h b/package/gluon-radv-filterd/src/mac.h index cc24d907..eece1105 100644 --- a/package/gluon-radv-filterd/src/mac.h +++ b/package/gluon-radv-filterd/src/mac.h @@ -1,4 +1,7 @@ +#pragma once + #include +#include #include #define F_MAC "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx" From ec582b77423b48b61d30ca10f0ed42c0553b95c2 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 5 Jul 2020 19:05:27 +0200 Subject: [PATCH 18/20] gluon-web: don't display outdoor mode on preserve_channels (#2074) This will hide the outdoor mode setting on compatible devices in case the defined channels should be preserved. Otherwise a user might be under the impression their device is compliant with outdoor operation when in reality it still uses prohibited channels. (cherry picked from commit 73b830eb32efe5772358b9b05fba57aa447c54af) --- .../luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua | 6 ++++++ package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless | 2 +- package/gluon-core/luasrc/usr/lib/lua/gluon/wireless.lua | 4 ++++ .../lib/gluon/config-mode/model/admin/wifi-config.lua | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua b/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua index ffa030dd..6a653df8 100644 --- a/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua +++ b/package/gluon-config-mode-outdoor/luasrc/lib/gluon/config-mode/wizard/0250-outdoor.lua @@ -1,11 +1,17 @@ return function(form, uci) local platform = require 'gluon.platform' + local wireless = require 'gluon.wireless' if not (platform.is_outdoor_device() and platform.device_uses_11a(uci)) then -- only visible on wizard for outdoor devices return end + if wireless.preserve_channels(uci) then + -- Don't show if channel should be preserved + return + end + local pkg_i18n = i18n 'gluon-config-mode-outdoor' local section = form:section(Section, nil, pkg_i18n.translate( diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless index 073d0694..1374e55c 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/200-wireless @@ -54,7 +54,7 @@ end local function get_channel(radio, config) local channel - if uci:get_first('gluon-core', 'wireless', 'preserve_channels') then + if wireless.preserve_channels(uci) then -- preserved channel always wins channel = radio.channel elseif (radio.hwmode == '11a' or radio.hwmode == '11na') and is_outdoor() then diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/wireless.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/wireless.lua index 8a2f4ed8..4f2cf088 100644 --- a/package/gluon-core/luasrc/usr/lib/lua/gluon/wireless.lua +++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/wireless.lua @@ -96,4 +96,8 @@ function M.foreach_radio(uci, f) end end +function M.preserve_channels(uci) + return uci:get_first('gluon-core', 'wireless', 'preserve_channels') +end + return M diff --git a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua index efc6d0f0..49580413 100644 --- a/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua +++ b/package/gluon-web-wifi-config/luasrc/lib/gluon/config-mode/model/admin/wifi-config.lua @@ -142,7 +142,7 @@ uci:foreach('wireless', 'wifi-device', function(config) end) -if has_5ghz_radio() then +if has_5ghz_radio() and not wireless.preserve_channels(uci) then local r = f:section(Section, translate("Outdoor Installation"), translate( "Configuring the node for outdoor use tunes the 5 GHz radio to a frequency " .. "and transmission power that conforms with the local regulatory requirements. " From 582d2d6954cad82fdb46afb111c255b09d16ae61 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 19 Jul 2020 16:49:08 +0200 Subject: [PATCH 19/20] docs: add v2020.2 release notes Closes #1979 Closes #2062 --- docs/index.rst | 1 + docs/releases/v2020.2.rst | 191 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 192 insertions(+) create mode 100644 docs/releases/v2020.2.rst diff --git a/docs/index.rst b/docs/index.rst index cf767073..b0594ff9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -78,6 +78,7 @@ Several Freifunk communities in Germany use Gluon as the foundation of their Fre :caption: Releases :maxdepth: 1 + releases/v2020.2 releases/v2020.1.3 releases/v2020.1.2 releases/v2020.1.1 diff --git a/docs/releases/v2020.2.rst b/docs/releases/v2020.2.rst new file mode 100644 index 00000000..6975c243 --- /dev/null +++ b/docs/releases/v2020.2.rst @@ -0,0 +1,191 @@ +Gluon 2020.2 +============ + +Added hardware support +---------------------- + +ath79-generic +~~~~~~~~~~~~~ + +* GL.iNet + + - GL-AR750S + +* TP-Link + + - CPE220 (v3) + +ipq40xx-generic +~~~~~~~~~~~~~~~ + +* EnGenius + + - ENS620EXT [#outdoor]_ + +* Linksys + + - EA6350 (v3) + +lantiq-xrx200 +~~~~~~~~~~~~~ + +* TP-Link + + - TD-W8970 + +lantiq-xway +~~~~~~~~~~~ + +* NETGEAR + + - DGN3500B + +ramips-mt76x8 +~~~~~~~~~~~~~ +* Cudy + + - WR1000 + + +x86-legacy [#newtarget]_ +~~~~~~~~~~~~~~~~~~~~~~~~ + +* Devices older than the Pentium 4 + + +.. [#newtarget] + This is a new target. + +.. [#outdoor] + This device is supposed to be set up outdoors and will therefore have its outdoor mode flag automatically enabled. + + +Major changes +------------- + +Device Classes +~~~~~~~~~~~~~~ + +Devices are now categorized into device classes. This device class can determine which features +as well as packages are installed on the device when building images. + +Currently there are two classes used in Gluon, *tiny* and *standard*. All devices with less than 64M of RAM or +less than 7M of usable firmware space are assigned to the tiny class. + +WPA3 support for Private WLAN +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The private WLAN now supports WPA3-SAE key exchange as well as management frame protection (802.11w). +For this to work, the firmware needs to be built with the *wireless-encryption-wpa3* feature. + +OWE on Client Network +~~~~~~~~~~~~~~~~~~~~~ + +Gluon now allows to configure a VAP for the client network which supports opportunistic encryption on the +client network for devices which support the OWE security type (also known as Enhanced Open). + +This encrypted VAP can be the only available access point or be configured in addition to an unencrypted VAP. +In the latter case, the transition mode can be enabled, which enables compatible devices to automatically +connect to the encrypted VAP while legacy devices continue to use the unencrypted connection. + +There are issues with some devices running Android 9 when connecting to a transition mode enabled network. See the site documentation for more information. + +SAE Encrypted Mesh Links +~~~~~~~~~~~~~~~~~~~~~~~~ + +Mesh links can now be operated in an encrypted mode using SAE authentication. For this to work, a common shared secret +has to be distributed to all participating nodes using the site.conf. + +Responsive status page +~~~~~~~~~~~~~~~~~~~~~~ + +The status page design is now responsive and reflows better on mobile devices. + +Primary domain code +~~~~~~~~~~~~~~~~~~~ + +The primary domain code is now visible on the node status page as well as in the respondd information +emitted by the node. + +Logging +~~~~~~~ + +The new *gluon-logging* package allows to configure a remote syslog server using the site.conf. +This package can only be included when *gluon-web-logging* is excluded. + +Peer cleanup in fastd +~~~~~~~~~~~~~~~~~~~~~ + +fastd peers and groups are now removed on update in case they do not exist in the new site configuration. +To preserve a custom peer across updates, add the *preserve* key to the peer's UCI configuration and set it to ``1``. + + +Bugfixes +-------- + +- The WAN MAC address now matches the one defined in OpenWrt if VXLAN is enabled for the selected domain. + +- *gluon-reload* now reloads all relevant services. + +- Disabling outdoor mode and enabling meshing in the config mode can now be performed in a single step. + +- Fixed section visiblity with enabled outdoor mode in config mode. + + +Site changes +------------ + +site.mk +~~~~~~~ + +Starting with version 19.07 OpenWrt ships the urngd entropy daemon by default. +It replaces the haveged daemon, for which we removed the support in Gluon. Remove ``haveged`` from your package selection. + + +Internal +-------- + +Editorconfig +~~~~~~~~~~~~ + +Gluon now ships a *editorconfig* file to allow compatible editors to automatically apply key aspects of Gluon's code style. + +Continuous Integration +~~~~~~~~~~~~~~~~~~~~~~ + +* Jenkins + + - The CI now has a test stage to verify Gluons runtime functionality. + +* GitHub Actions + + - GitHub actions is now enabled for the Gluon project, build-testing all available targets. + +Build system +~~~~~~~~~~~~ + +- Source code minification can now be skipped by enabling the GLUON_MINIFY flag. + +- Enabling the GLUON_AUTOREMOVE flag will remove package build directories after they are built. + This reduces space consumption at the expense of subsequent builds being slower. + + +Known issues +------------ + +* Out of memory situations with high client count on ath9k. + (`#1768 `_) + +* The integration of the BATMAN_V routing algorithm is incomplete. + + - Mesh neighbors don't appear on the status page. (`#1726 `_) + Many tools have the BATMAN_IV metric hardcoded, these need to be updated to account for the new throughput + metric. + - Throughput values are not correctly acquired for different interface types. + (`#1728 `_) + This affects virtual interface types like bridges and VXLAN. + +* Default TX power on many Ubiquiti devices is too high, correct offsets are unknown + (`#94 `_) + + Reducing the TX power in the Advanced Settings is recommended. From bf8c3babae71070c10408948a04d7ede138de8ff Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sun, 19 Jul 2020 16:53:08 +0200 Subject: [PATCH 20/20] docs, README: Gluon v2020.2 --- README.md | 2 +- docs/conf.py | 2 +- docs/site-example/site.conf | 2 +- docs/user/getting_started.rst | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8158ae17..93e88519 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ the future development of Gluon. Please refrain from using the `master` branch for anything else but development purposes! Use the most recent release instead. You can list all releases by running `git tag` -and switch to one by running `git checkout v2020.1.3 && make update`. +and switch to one by running `git checkout v2020.2 && make update`. If you're using the autoupdater, do not autoupdate nodes with anything but releases. If you upgrade using random master commits the nodes *will break* eventually. diff --git a/docs/conf.py b/docs/conf.py index 4f7e5191..cec8a8da 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,7 +24,7 @@ copyright = '2015-2020, Project Gluon' author = 'Project Gluon' # The short X.Y version -version = '2020.1+' +version = '2020.2' # The full version, including alpha/beta/rc tags release = version diff --git a/docs/site-example/site.conf b/docs/site-example/site.conf index 22f78502..2e92c1d6 100644 --- a/docs/site-example/site.conf +++ b/docs/site-example/site.conf @@ -1,4 +1,4 @@ --- This is an example site configuration for Gluon v2020.1.3 +-- This is an example site configuration for Gluon v2020.2 -- -- Take a look at the documentation located at -- https://gluon.readthedocs.io/ for details. diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 36d9260e..08206875 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -8,7 +8,7 @@ Gluon's releases are managed using `Git tags`_. If you are just getting started with Gluon we recommend to use the latest stable release of Gluon. Take a look at the `list of gluon releases`_ and notice the latest release, -e.g. *v2020.1.3*. Always get Gluon using git and don't try to download it +e.g. *v2020.2*. Always get Gluon using git and don't try to download it as a Zip archive as the archive will be missing version information. Please keep in mind that there is no "default Gluon" build; a site configuration @@ -44,7 +44,7 @@ Building the images ------------------- To build Gluon, first check out the repository. Replace *RELEASE* with the -version you'd like to checkout, e.g. *v2020.1.3*. +version you'd like to checkout, e.g. *v2020.2*. ::