From 02ed2b0271c5e17584884146649d7fb64a9ac35d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 28 Sep 2023 10:28:43 +0200 Subject: [PATCH 1/4] hostapd: fix wpa_supplicant mac address allocation on ap+sta MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the full interface is restarted while bringing up an AP, it can trigger a wpa_supplicant interface start before wpa_supplicant is notified of the allocated mac addresses. Fix this by moving the iface_update_supplicant_macaddr call to just after the point where mac addresses are allocated. Reported-by: Michael-cy Lee (李峻宇) Signed-off-by: Felix Fietkau (cherry picked from commit abceef120d57bf066941882630a76788eb4985a9) --- .../network/services/hostapd/files/hostapd.uc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 5cddb9c268..88f01caa93 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -122,6 +122,14 @@ function iface_config_macaddr_list(config) return macaddr_list; } +function iface_update_supplicant_macaddr(phy, config) +{ + let macaddr_list = []; + for (let i = 0; i < length(config.bss); i++) + push(macaddr_list, config.bss[i].bssid); + ubus.call("wpa_supplicant", "phy_set_macaddr_list", { phy: phy, macaddr: macaddr_list }); +} + function iface_restart(phydev, config, old_config) { let phy = phydev.name; @@ -142,6 +150,8 @@ function iface_restart(phydev, config, old_config) bss.bssid = phydev.macaddr_next(); } + iface_update_supplicant_macaddr(phy, config); + let bss = config.bss[0]; let err = wdev_create(phy, bss.ifname, { mode: "ap" }); if (err) @@ -498,14 +508,6 @@ function iface_reload_config(phydev, config, old_config) return true; } -function iface_update_supplicant_macaddr(phy, config) -{ - let macaddr_list = []; - for (let i = 0; i < length(config.bss); i++) - push(macaddr_list, config.bss[i].bssid); - ubus.call("wpa_supplicant", "phy_set_macaddr_list", { phy: phy, macaddr: macaddr_list }); -} - function iface_set_config(phy, config) { let old_config = hostapd.data.config[phy]; @@ -536,7 +538,6 @@ function iface_set_config(phy, config) hostapd.printf(`Restart interface for phy ${phy}`); let ret = iface_restart(phydev, config, old_config); - iface_update_supplicant_macaddr(phy, config); return ret; } From 7fe85ce1f2d53384561517bd0c8818d3b2ea43fc Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Fri, 29 Sep 2023 11:12:02 +0200 Subject: [PATCH 2/4] hostapd: increase PKG_RELEASE to fix builds Recent hostapd changes just edited the ucode files. It is required to bump the PKG_RELEASE to include the newest changes in the latest builds. Signed-off-by: Nick Hainke (cherry picked from commit 91d2ead3c3bf75b279f861ad5d11b64bf31478f0) --- package/network/services/hostapd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 5537500313..64048a963a 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git From 50690dd5cccf4ecefc75a6eeb71893a2342ea2d7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 29 Sep 2023 20:28:35 +0200 Subject: [PATCH 3/4] OpenWrt v23.05.0-rc4: adjust config defaults Signed-off-by: Hauke Mehrtens --- feeds.conf.default | 8 ++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 + version.date | 1 + 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 version create mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index d467db5627..a636e6747d 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git packages https://git.openwrt.org/feed/packages.git;openwrt-23.05 -src-git luci https://git.openwrt.org/project/luci.git;openwrt-23.05 -src-git routing https://git.openwrt.org/feed/routing.git;openwrt-23.05 -src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-23.05 +src-git packages https://git.openwrt.org/feed/packages.git^5f3879f714f71fef775b6190a0e597d3aa0e2e80 +src-git luci https://git.openwrt.org/project/luci.git^99559f95b89f71535b340ee94db2edee28f755d4 +src-git routing https://git.openwrt.org/feed/routing.git^2272106e0839ee06957e88e3596489e1b510d3c2 +src-git telephony https://git.openwrt.org/feed/telephony.git^c6b1315c235c1c42282fa04f897a527dabbaff6c diff --git a/include/version.mk b/include/version.mk index 924bf83541..138b2faab6 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05-SNAPSHOT) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05.0-rc4) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r23482-7fe85ce1f2) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/23.05-SNAPSHOT) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/23.05.0-rc4) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 9a72863813..fdf857c17f 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -190,7 +190,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/23.05-SNAPSHOT" + default "https://downloads.openwrt.org/releases/23.05.0-rc4" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -266,7 +266,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default y + default n help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version new file mode 100644 index 0000000000..c30cf4f0d0 --- /dev/null +++ b/version @@ -0,0 +1 @@ +r23482-7fe85ce1f2 diff --git a/version.date b/version.date new file mode 100644 index 0000000000..8b6b6b9980 --- /dev/null +++ b/version.date @@ -0,0 +1 @@ +1695979776 From b742216dc86340c06c243caba7e15b83954fd659 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 29 Sep 2023 20:28:43 +0200 Subject: [PATCH 4/4] OpenWrt v23.05.0-rc4: revert to branch defaults Signed-off-by: Hauke Mehrtens --- feeds.conf.default | 8 ++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 - version.date | 1 - 5 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 version delete mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index a636e6747d..d467db5627 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git packages https://git.openwrt.org/feed/packages.git^5f3879f714f71fef775b6190a0e597d3aa0e2e80 -src-git luci https://git.openwrt.org/project/luci.git^99559f95b89f71535b340ee94db2edee28f755d4 -src-git routing https://git.openwrt.org/feed/routing.git^2272106e0839ee06957e88e3596489e1b510d3c2 -src-git telephony https://git.openwrt.org/feed/telephony.git^c6b1315c235c1c42282fa04f897a527dabbaff6c +src-git packages https://git.openwrt.org/feed/packages.git;openwrt-23.05 +src-git luci https://git.openwrt.org/project/luci.git;openwrt-23.05 +src-git routing https://git.openwrt.org/feed/routing.git;openwrt-23.05 +src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-23.05 diff --git a/include/version.mk b/include/version.mk index 138b2faab6..924bf83541 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05.0-rc4) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),23.05-SNAPSHOT) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r23482-7fe85ce1f2) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/23.05.0-rc4) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/23.05-SNAPSHOT) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index fdf857c17f..9a72863813 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -190,7 +190,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/23.05.0-rc4" + default "https://downloads.openwrt.org/releases/23.05-SNAPSHOT" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -266,7 +266,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default n + default y help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version deleted file mode 100644 index c30cf4f0d0..0000000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -r23482-7fe85ce1f2 diff --git a/version.date b/version.date deleted file mode 100644 index 8b6b6b9980..0000000000 --- a/version.date +++ /dev/null @@ -1 +0,0 @@ -1695979776