Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
46c4f39158
@ -24,21 +24,19 @@ start() {
|
||||
|
||||
for i in $(ip address | awk -F ': ' '/eth[0-9]+/ {print $2}' | grep -v '@' | xargs)
|
||||
do
|
||||
{
|
||||
ethtool -K "$i" rx-checksum on
|
||||
ethtool -K "$i" tx-checksum-ip-generic on || {
|
||||
ethtool -K "$i" tx-checksum-ipv4 on
|
||||
ethtool -K "$i" tx-checksum-ipv6 on
|
||||
}
|
||||
ethtool -K "$i" tx-scatter-gather on
|
||||
ethtool -K "$i" gso on
|
||||
ethtool -K "$i" tso on
|
||||
ethtool -K "$i" ufo on
|
||||
|
||||
if ethtool -i "$i" | grep -q "driver: igc"; then
|
||||
ethtool -G "$i" rx "$(ethtool -g "$i" | awk '/^RX:/ {print $2; exit}')"
|
||||
ethtool -G "$i" tx "$(ethtool -g "$i" | awk '/^TX:/ {print $2; exit}')"
|
||||
fi
|
||||
ethtool -K "$i" rx-checksum on
|
||||
ethtool -K "$i" tx-checksum-ip-generic on || {
|
||||
ethtool -K "$i" tx-checksum-ipv4 on
|
||||
ethtool -K "$i" tx-checksum-ipv6 on
|
||||
}
|
||||
ethtool -K "$i" tx-scatter-gather on
|
||||
ethtool -K "$i" gso on
|
||||
ethtool -K "$i" tso on
|
||||
ethtool -K "$i" ufo on
|
||||
|
||||
if ethtool -i "$i" | grep -q "driver: igc"; then
|
||||
ethtool -G "$i" rx "$(ethtool -g "$i" | awk '/^RX:/ {print $2; exit}')"
|
||||
ethtool -G "$i" tx "$(ethtool -g "$i" | awk '/^TX:/ {print $2; exit}')"
|
||||
fi
|
||||
done
|
||||
} >"/dev/null" 2>&1
|
||||
|
@ -1324,17 +1324,13 @@ $(eval $(call KernelPackage,mpls))
|
||||
define KernelPackage/9pnet
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=Plan 9 Resource Sharing Support (9P2000)
|
||||
DEPENDS:=@VIRTIO_SUPPORT
|
||||
KCONFIG:= \
|
||||
CONFIG_NET_9P \
|
||||
CONFIG_NET_9P_DEBUG=n \
|
||||
CONFIG_NET_9P_XEN=n \
|
||||
CONFIG_NET_9P_VIRTIO \
|
||||
CONFIG_NET_9P_FD=n@ge5.17
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/net/9p/9pnet.ko \
|
||||
$(LINUX_DIR)/net/9p/9pnet_virtio.ko
|
||||
AUTOLOAD:=$(call AutoLoad,29,9pnet 9pnet_virtio)
|
||||
$(LINUX_DIR)/net/9p/9pnet.ko
|
||||
AUTOLOAD:=$(call AutoLoad,29,9pnet)
|
||||
endef
|
||||
|
||||
define KernelPackage/9pnet/description
|
||||
@ -1344,6 +1340,25 @@ endef
|
||||
|
||||
$(eval $(call KernelPackage,9pnet))
|
||||
|
||||
define KernelPackage/9pvirtio
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
TITLE:=Plan 9 Virtio Support
|
||||
DEPENDS:=+kmod-9pnet @VIRTIO_SUPPORT
|
||||
KCONFIG:= \
|
||||
CONFIG_NET_9P_XEN=n \
|
||||
CONFIG_NET_9P_VIRTIO
|
||||
FILES:= \
|
||||
$(LINUX_DIR)/net/9p/9pnet_virtio.ko
|
||||
AUTOLOAD:=$(call AutoLoad,29,9pnet_virtio)
|
||||
endef
|
||||
|
||||
define KernelPackage/9pvirtio/description
|
||||
Kernel support support for
|
||||
Plan 9 resource sharing for virtio.
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,9pvirtio))
|
||||
|
||||
|
||||
define KernelPackage/nlmon
|
||||
SUBMENU:=$(NETWORK_SUPPORT_MENU)
|
||||
|
@ -0,0 +1,149 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 14 Sep 2023 13:17:16 +0200
|
||||
Subject: [PATCH] cfg80211: allow grace period for DFS available after beacon
|
||||
shutdown
|
||||
|
||||
Fixes reconfiguring an AP on a DFS channel in non-ETSI regdomain
|
||||
|
||||
Fixes: b35a51c7dd25 ("cfg80211: Make pre-CAC results valid only for ETSI domain")
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/net/cfg80211.h
|
||||
+++ b/include/net/cfg80211.h
|
||||
@@ -175,6 +175,8 @@ enum ieee80211_channel_flags {
|
||||
* @dfs_state: current state of this channel. Only relevant if radar is required
|
||||
* on this channel.
|
||||
* @dfs_state_entered: timestamp (jiffies) when the dfs state was entered.
|
||||
+ * @dfs_state_last_available: timestamp (jiffies) of the last time when the
|
||||
+ * channel was available.
|
||||
* @dfs_cac_ms: DFS CAC time in milliseconds, this is valid for DFS channels.
|
||||
*/
|
||||
struct ieee80211_channel {
|
||||
@@ -191,6 +193,7 @@ struct ieee80211_channel {
|
||||
int orig_mag, orig_mpwr;
|
||||
enum nl80211_dfs_state dfs_state;
|
||||
unsigned long dfs_state_entered;
|
||||
+ unsigned long dfs_state_last_available;
|
||||
unsigned int dfs_cac_ms;
|
||||
};
|
||||
|
||||
--- a/net/wireless/ap.c
|
||||
+++ b/net/wireless/ap.c
|
||||
@@ -30,6 +30,9 @@ static int ___cfg80211_stop_ap(struct cf
|
||||
if (!wdev->links[link_id].ap.beacon_interval)
|
||||
return -ENOENT;
|
||||
|
||||
+ cfg80211_update_last_available(wdev->wiphy,
|
||||
+ &wdev->links[link_id].ap.chandef);
|
||||
+
|
||||
err = rdev_stop_ap(rdev, dev, link_id);
|
||||
if (!err) {
|
||||
wdev->conn_owner_nlportid = 0;
|
||||
@@ -41,9 +44,6 @@ static int ___cfg80211_stop_ap(struct cf
|
||||
if (notify)
|
||||
nl80211_send_ap_stopped(wdev, link_id);
|
||||
|
||||
- /* Should we apply the grace period during beaconing interface
|
||||
- * shutdown also?
|
||||
- */
|
||||
cfg80211_sched_dfs_chan_update(rdev);
|
||||
}
|
||||
|
||||
--- a/net/wireless/chan.c
|
||||
+++ b/net/wireless/chan.c
|
||||
@@ -461,6 +461,8 @@ static void cfg80211_set_chans_dfs_state
|
||||
|
||||
c->dfs_state = dfs_state;
|
||||
c->dfs_state_entered = jiffies;
|
||||
+ if (dfs_state == NL80211_DFS_AVAILABLE)
|
||||
+ c->dfs_state_last_available = jiffies;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -873,6 +875,49 @@ static bool cfg80211_get_chans_dfs_avail
|
||||
return true;
|
||||
}
|
||||
|
||||
+static void
|
||||
+__cfg80211_update_last_available(struct wiphy *wiphy,
|
||||
+ u32 center_freq,
|
||||
+ u32 bandwidth)
|
||||
+{
|
||||
+ struct ieee80211_channel *c;
|
||||
+ u32 freq, start_freq, end_freq;
|
||||
+
|
||||
+ start_freq = cfg80211_get_start_freq(center_freq, bandwidth);
|
||||
+ end_freq = cfg80211_get_end_freq(center_freq, bandwidth);
|
||||
+
|
||||
+ /*
|
||||
+ * Check entire range of channels for the bandwidth.
|
||||
+ * If any channel in between is disabled or has not
|
||||
+ * had gone through CAC return false
|
||||
+ */
|
||||
+ for (freq = start_freq; freq <= end_freq; freq += MHZ_TO_KHZ(20)) {
|
||||
+ c = ieee80211_get_channel_khz(wiphy, freq);
|
||||
+ if (!c)
|
||||
+ return;
|
||||
+
|
||||
+ c->dfs_state_last_available = jiffies;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void cfg80211_update_last_available(struct wiphy *wiphy,
|
||||
+ const struct cfg80211_chan_def *chandef)
|
||||
+{
|
||||
+ int width;
|
||||
+
|
||||
+ width = cfg80211_chandef_get_width(chandef);
|
||||
+ if (width < 0)
|
||||
+ return;
|
||||
+
|
||||
+ __cfg80211_update_last_available(wiphy, MHZ_TO_KHZ(chandef->center_freq1),
|
||||
+ width);
|
||||
+ if (chandef->width != NL80211_CHAN_WIDTH_80P80)
|
||||
+ return;
|
||||
+
|
||||
+ __cfg80211_update_last_available(wiphy, MHZ_TO_KHZ(chandef->center_freq2),
|
||||
+ width);
|
||||
+}
|
||||
+
|
||||
static bool cfg80211_chandef_dfs_available(struct wiphy *wiphy,
|
||||
const struct cfg80211_chan_def *chandef)
|
||||
{
|
||||
--- a/net/wireless/core.h
|
||||
+++ b/net/wireless/core.h
|
||||
@@ -487,6 +487,8 @@ void cfg80211_set_dfs_state(struct wiphy
|
||||
enum nl80211_dfs_state dfs_state);
|
||||
|
||||
void cfg80211_dfs_channels_update_work(struct work_struct *work);
|
||||
+void cfg80211_update_last_available(struct wiphy *wiphy,
|
||||
+ const struct cfg80211_chan_def *chandef);
|
||||
|
||||
unsigned int
|
||||
cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy,
|
||||
--- a/net/wireless/mlme.c
|
||||
+++ b/net/wireless/mlme.c
|
||||
@@ -915,6 +915,8 @@ void cfg80211_dfs_channels_update_work(s
|
||||
if (c->dfs_state == NL80211_DFS_UNAVAILABLE) {
|
||||
time_dfs_update = IEEE80211_DFS_MIN_NOP_TIME_MS;
|
||||
radar_event = NL80211_RADAR_NOP_FINISHED;
|
||||
+ timeout = c->dfs_state_entered +
|
||||
+ msecs_to_jiffies(time_dfs_update);
|
||||
} else {
|
||||
if (regulatory_pre_cac_allowed(wiphy) ||
|
||||
cfg80211_any_wiphy_oper_chan(wiphy, c))
|
||||
@@ -922,11 +924,10 @@ void cfg80211_dfs_channels_update_work(s
|
||||
|
||||
time_dfs_update = REG_PRE_CAC_EXPIRY_GRACE_MS;
|
||||
radar_event = NL80211_RADAR_PRE_CAC_EXPIRED;
|
||||
+ timeout = c->dfs_state_last_available +
|
||||
+ msecs_to_jiffies(time_dfs_update);
|
||||
}
|
||||
|
||||
- timeout = c->dfs_state_entered +
|
||||
- msecs_to_jiffies(time_dfs_update);
|
||||
-
|
||||
if (time_after_eq(jiffies, timeout)) {
|
||||
c->dfs_state = NL80211_DFS_USABLE;
|
||||
c->dfs_state_entered = jiffies;
|
@ -5,9 +5,9 @@ PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
|
||||
PKG_SOURCE_DATE:=2023-08-31
|
||||
PKG_SOURCE_VERSION:=1a07f1dff32b3af49e39533e33e8964b59535662
|
||||
PKG_MIRROR_HASH:=dc621dd04c3c9631002f929cf10a4620f57af8b0baf614c590bda17957fa6201
|
||||
PKG_SOURCE_DATE:=2023-09-15.1
|
||||
PKG_SOURCE_VERSION:=afcd3825dad9b6a6712fbf6ed8e4434819a34009
|
||||
PKG_MIRROR_HASH:=d389db5dec7140fc12f69e8d679b9242c72d27b35c789b12adc6ebdf16913a85
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
@ -1,7 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
ifup_all=
|
||||
setup_wifi=
|
||||
|
||||
if_call() {
|
||||
local interface="$1"
|
||||
@ -14,7 +13,6 @@ case "$0" in
|
||||
*ifdown) modes=down;;
|
||||
*ifup)
|
||||
modes="down up"
|
||||
setup_wifi=1
|
||||
;;
|
||||
*) echo "Invalid command: $0";;
|
||||
esac
|
||||
@ -25,10 +23,6 @@ while :; do
|
||||
ifup_all=1
|
||||
shift
|
||||
;;
|
||||
-w)
|
||||
setup_wifi=
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
@ -40,7 +34,6 @@ if [ -n "$ifup_all" ]; then
|
||||
for interface in $(ubus -S list 'network.interface.*'); do
|
||||
if_call "${interface##network.interface.}"
|
||||
done
|
||||
[ -n "$setup_wifi" ] && /sbin/wifi up
|
||||
exit
|
||||
else
|
||||
ubus -S list "network.interface.$1" > /dev/null || {
|
||||
@ -49,29 +42,3 @@ else
|
||||
}
|
||||
if_call "$1"
|
||||
fi
|
||||
|
||||
if [ -n "$setup_wifi" ] && grep -sq config /etc/config/wireless; then
|
||||
. /lib/functions.sh
|
||||
|
||||
find_related_radios() {
|
||||
local wdev wnet
|
||||
config_get wdev "$1" device
|
||||
config_get wnet "$1" network
|
||||
|
||||
if [ -n "$wdev" ]; then
|
||||
for wnet in $wnet; do
|
||||
if [ "$wnet" = "$network" ]; then
|
||||
append radio_devs "$wdev" "$N"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
network="$1"
|
||||
config_load wireless
|
||||
config_foreach find_related_radios wifi-iface
|
||||
|
||||
for dev in $(echo "$radio_devs" | sort -u); do
|
||||
/sbin/wifi up "$dev"
|
||||
done
|
||||
fi
|
||||
|
@ -5,7 +5,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostapd
|
||||
PKG_RELEASE:=2
|
||||
PKG_RELEASE:=3
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
|
@ -215,6 +215,7 @@ function bss_remove_file_fields(config)
|
||||
for (let key in config.hash)
|
||||
new_cfg.hash[key] = config.hash[key];
|
||||
delete new_cfg.hash.wpa_psk_file;
|
||||
delete new_cfg.hash.vlan_file;
|
||||
|
||||
return new_cfg;
|
||||
}
|
||||
@ -475,11 +476,12 @@ function iface_reload_config(phydev, config, old_config)
|
||||
bss_remove_file_fields(bss_list_cfg[i]))) {
|
||||
hostapd.printf(`Update config data files for bss ${ifname}`);
|
||||
if (bss.set_config(config_inline, i, true) < 0) {
|
||||
hostapd.printf(`Failed to update config data files for bss ${ifname}`);
|
||||
hostapd.printf(`Could not update config data files for bss ${ifname}`);
|
||||
return false;
|
||||
} else {
|
||||
bss.ctrl("RELOAD_WPA_PSK");
|
||||
continue;
|
||||
}
|
||||
bss.ctrl("RELOAD_WPA_PSK");
|
||||
continue;
|
||||
}
|
||||
|
||||
bss_reload_psk(bss, config.bss[i], bss_list_cfg[i]);
|
||||
@ -487,8 +489,6 @@ function iface_reload_config(phydev, config, old_config)
|
||||
continue;
|
||||
|
||||
hostapd.printf(`Reload config for bss '${config.bss[0].ifname}' on phy '${phy}'`);
|
||||
hostapd.printf(`old: ${bss_remove_file_fields(bss_list_cfg[i])}`);
|
||||
hostapd.printf(`new: ${bss_remove_file_fields(config.bss[i])}`);
|
||||
if (bss.set_config(config_inline, i) < 0) {
|
||||
hostapd.printf(`Failed to set config for bss ${ifname}`);
|
||||
return false;
|
||||
@ -688,7 +688,6 @@ let main_obj = {
|
||||
freq_info.csa_count = req.args.csa_count ?? 10;
|
||||
ret = iface.switch_channel(freq_info);
|
||||
} else {
|
||||
iface.stop();
|
||||
ret = iface.start(freq_info);
|
||||
}
|
||||
if (!ret)
|
||||
|
@ -3,6 +3,12 @@
|
||||
"access": {
|
||||
"service": {
|
||||
"methods": [ "event" ]
|
||||
},
|
||||
"wpa_supplicant": {
|
||||
"methods": [ "phy_set_state", "phy_set_macaddr_list", "phy_status" ]
|
||||
},
|
||||
"hostapd": {
|
||||
"methods": [ "apsta_state" ]
|
||||
}
|
||||
},
|
||||
"publish": [ "hostapd", "hostapd.*", "wpa_supplicant", "wpa_supplicant.*" ],
|
||||
|
@ -0,0 +1,20 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 14 Sep 2023 10:53:50 +0200
|
||||
Subject: [PATCH] driver_nl80211: fix setting QoS map on secondary BSSs
|
||||
|
||||
The setting is per-BSS, not per PHY
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -11341,7 +11341,7 @@ static int nl80211_set_qos_map(void *pri
|
||||
wpa_hexdump(MSG_DEBUG, "nl80211: Setting QoS Map",
|
||||
qos_map_set, qos_map_set_len);
|
||||
|
||||
- if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_SET_QOS_MAP)) ||
|
||||
+ if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_QOS_MAP)) ||
|
||||
nla_put(msg, NL80211_ATTR_QOS_MAP, qos_map_set_len, qos_map_set)) {
|
||||
nlmsg_free(msg);
|
||||
return -ENOBUFS;
|
@ -0,0 +1,18 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 14 Sep 2023 11:28:03 +0200
|
||||
Subject: [PATCH] driver_nl80211: update drv->ifindex on removing the first
|
||||
BSS
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -8867,6 +8867,7 @@ static int wpa_driver_nl80211_if_remove(
|
||||
if (drv->first_bss->next) {
|
||||
drv->first_bss = drv->first_bss->next;
|
||||
drv->ctx = drv->first_bss->ctx;
|
||||
+ drv->ifindex = drv->first_bss->ifindex;
|
||||
os_free(bss);
|
||||
} else {
|
||||
wpa_printf(MSG_DEBUG, "nl80211: No second BSS to reassign context to");
|
@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
struct wpa_driver_set_key_params {
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -11666,6 +11666,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
@@ -11667,6 +11667,18 @@ static int nl80211_put_mesh_id(struct nl
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com>
|
||||
static int nl80211_put_mesh_config(struct nl_msg *msg,
|
||||
struct wpa_driver_mesh_bss_params *params)
|
||||
{
|
||||
@@ -11727,6 +11739,7 @@ static int nl80211_join_mesh(struct i802
|
||||
@@ -11728,6 +11740,7 @@ static int nl80211_join_mesh(struct i802
|
||||
nl80211_put_basic_rates(msg, params->basic_rates) ||
|
||||
nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) ||
|
||||
nl80211_put_beacon_int(msg, params->beacon_int) ||
|
||||
|
@ -443,7 +443,7 @@
|
||||
}
|
||||
|
||||
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
|
||||
@@ -8874,6 +8871,50 @@ static int wpa_driver_nl80211_if_remove(
|
||||
@@ -8875,6 +8872,50 @@ static int wpa_driver_nl80211_if_remove(
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -494,7 +494,7 @@
|
||||
|
||||
static int cookie_handler(struct nl_msg *msg, void *arg)
|
||||
{
|
||||
@@ -10512,6 +10553,37 @@ static int driver_nl80211_if_remove(void
|
||||
@@ -10513,6 +10554,37 @@ static int driver_nl80211_if_remove(void
|
||||
}
|
||||
|
||||
|
||||
@ -532,7 +532,7 @@
|
||||
static int driver_nl80211_send_mlme(void *priv, const u8 *data,
|
||||
size_t data_len, int noack,
|
||||
unsigned int freq,
|
||||
@@ -13696,6 +13768,8 @@ const struct wpa_driver_ops wpa_driver_n
|
||||
@@ -13697,6 +13769,8 @@ const struct wpa_driver_ops wpa_driver_n
|
||||
.set_acl = wpa_driver_nl80211_set_acl,
|
||||
.if_add = wpa_driver_nl80211_if_add,
|
||||
.if_remove = driver_nl80211_if_remove,
|
||||
|
@ -115,7 +115,7 @@
|
||||
* get_wowlan - Get wake-on-wireless status
|
||||
--- a/src/drivers/driver_nl80211.c
|
||||
+++ b/src/drivers/driver_nl80211.c
|
||||
@@ -12167,7 +12167,7 @@ static const char * drv_br_net_param_str
|
||||
@@ -12168,7 +12168,7 @@ static const char * drv_br_net_param_str
|
||||
|
||||
|
||||
static int wpa_driver_br_set_net_param(void *priv, enum drv_br_net_param param,
|
||||
@ -124,7 +124,7 @@
|
||||
{
|
||||
struct i802_bss *bss = priv;
|
||||
char path[128];
|
||||
@@ -12193,8 +12193,11 @@ static int wpa_driver_br_set_net_param(v
|
||||
@@ -12194,8 +12194,11 @@ static int wpa_driver_br_set_net_param(v
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -111,6 +111,94 @@ uc_hostapd_remove_iface(uc_vm_t *vm, size_t nargs)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct hostapd_vlan *
|
||||
bss_conf_find_vlan(struct hostapd_bss_config *bss, int id)
|
||||
{
|
||||
struct hostapd_vlan *vlan;
|
||||
|
||||
for (vlan = bss->vlan; vlan; vlan = vlan->next)
|
||||
if (vlan->vlan_id == id)
|
||||
return vlan;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
bss_conf_rename_vlan(struct hostapd_data *hapd, struct hostapd_vlan *vlan,
|
||||
const char *ifname)
|
||||
{
|
||||
if (!strcmp(ifname, vlan->ifname))
|
||||
return 0;
|
||||
|
||||
hostapd_drv_if_rename(hapd, WPA_IF_AP_VLAN, vlan->ifname, ifname);
|
||||
os_strlcpy(vlan->ifname, ifname, sizeof(vlan->ifname));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
bss_reload_vlans(struct hostapd_data *hapd, struct hostapd_bss_config *bss)
|
||||
{
|
||||
struct hostapd_bss_config *old_bss = hapd->conf;
|
||||
struct hostapd_vlan *vlan, *vlan_new, *wildcard;
|
||||
char ifname[IFNAMSIZ + 1], vlan_ifname[IFNAMSIZ + 1], *pos;
|
||||
int ret;
|
||||
|
||||
vlan = bss_conf_find_vlan(old_bss, VLAN_ID_WILDCARD);
|
||||
wildcard = bss_conf_find_vlan(bss, VLAN_ID_WILDCARD);
|
||||
if (!!vlan != !!wildcard)
|
||||
return -1;
|
||||
|
||||
if (vlan && wildcard && strcmp(vlan->ifname, wildcard->ifname) != 0)
|
||||
strcpy(vlan->ifname, wildcard->ifname);
|
||||
else
|
||||
wildcard = NULL;
|
||||
|
||||
for (vlan = bss->vlan; vlan; vlan = vlan->next) {
|
||||
if (vlan->vlan_id == VLAN_ID_WILDCARD ||
|
||||
vlan->dynamic_vlan > 0)
|
||||
continue;
|
||||
|
||||
if (!bss_conf_find_vlan(old_bss, vlan->vlan_id))
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (vlan = old_bss->vlan; vlan; vlan = vlan->next) {
|
||||
if (vlan->vlan_id == VLAN_ID_WILDCARD)
|
||||
continue;
|
||||
|
||||
if (vlan->dynamic_vlan == 0) {
|
||||
vlan_new = bss_conf_find_vlan(bss, vlan->vlan_id);
|
||||
if (!vlan_new)
|
||||
return -1;
|
||||
|
||||
if (bss_conf_rename_vlan(hapd, vlan, vlan_new->ifname))
|
||||
return -1;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!wildcard)
|
||||
continue;
|
||||
|
||||
os_strlcpy(ifname, wildcard->ifname, sizeof(ifname));
|
||||
pos = os_strchr(ifname, '#');
|
||||
if (!pos)
|
||||
return -1;
|
||||
|
||||
*pos++ = '\0';
|
||||
ret = os_snprintf(vlan_ifname, sizeof(vlan_ifname), "%s%d%s",
|
||||
ifname, vlan->vlan_id, pos);
|
||||
if (os_snprintf_error(sizeof(vlan_ifname), ret))
|
||||
return -1;
|
||||
|
||||
if (bss_conf_rename_vlan(hapd, vlan, vlan_ifname))
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uc_value_t *
|
||||
uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
|
||||
{
|
||||
@ -150,6 +238,7 @@ uc_hostapd_bss_set_config(uc_vm_t *vm, size_t nargs)
|
||||
} while (0)
|
||||
|
||||
swap_field(ssid.wpa_psk_file);
|
||||
ret = bss_reload_vlans(hapd, bss);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -382,13 +471,23 @@ uc_hostapd_iface_stop(uc_vm_t *vm, size_t nargs)
|
||||
struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
|
||||
int i;
|
||||
|
||||
switch (iface->state) {
|
||||
case HAPD_IFACE_ENABLED:
|
||||
case HAPD_IFACE_DISABLED:
|
||||
break;
|
||||
#ifdef CONFIG_ACS
|
||||
if (iface->state == HAPD_IFACE_ACS) {
|
||||
case HAPD_IFACE_ACS:
|
||||
acs_cleanup(iface);
|
||||
iface->scan_cb = NULL;
|
||||
hostapd_disable_iface(iface);
|
||||
}
|
||||
/* fallthrough */
|
||||
#endif
|
||||
default:
|
||||
hostapd_disable_iface(iface);
|
||||
break;
|
||||
}
|
||||
|
||||
if (iface->state != HAPD_IFACE_ENABLED)
|
||||
hostapd_disable_iface(iface);
|
||||
|
||||
for (i = 0; i < iface->num_bss; i++) {
|
||||
struct hostapd_data *hapd = iface->bss[i];
|
||||
@ -406,28 +505,37 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
|
||||
struct hostapd_iface *iface = uc_fn_thisval("hostapd.iface");
|
||||
uc_value_t *info = uc_fn_arg(0);
|
||||
struct hostapd_config *conf;
|
||||
bool changed = false;
|
||||
uint64_t intval;
|
||||
int i;
|
||||
|
||||
if (!iface)
|
||||
return NULL;
|
||||
|
||||
iface->freq = 0;
|
||||
if (!info)
|
||||
if (!info) {
|
||||
iface->freq = 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ucv_type(info) != UC_OBJECT)
|
||||
return NULL;
|
||||
|
||||
#define UPDATE_VAL(field, name) \
|
||||
if ((intval = ucv_int64_get(ucv_object_get(info, name, NULL))) && \
|
||||
!errno && intval != conf->field) do { \
|
||||
conf->field = intval; \
|
||||
changed = true; \
|
||||
} while(0)
|
||||
|
||||
conf = iface->conf;
|
||||
if ((intval = ucv_int64_get(ucv_object_get(info, "op_class", NULL))) && !errno)
|
||||
conf->op_class = intval;
|
||||
if ((intval = ucv_int64_get(ucv_object_get(info, "hw_mode", NULL))) && !errno)
|
||||
conf->hw_mode = intval;
|
||||
if ((intval = ucv_int64_get(ucv_object_get(info, "channel", NULL))) && !errno)
|
||||
conf->channel = intval;
|
||||
if ((intval = ucv_int64_get(ucv_object_get(info, "sec_channel", NULL))) && !errno)
|
||||
conf->secondary_channel = intval;
|
||||
UPDATE_VAL(op_class, "op_class");
|
||||
UPDATE_VAL(hw_mode, "hw_mode");
|
||||
UPDATE_VAL(channel, "channel");
|
||||
UPDATE_VAL(secondary_channel, "sec_channel");
|
||||
if (!changed &&
|
||||
(iface->bss[0]->beacon_set_done ||
|
||||
iface->state == HAPD_IFACE_DFS))
|
||||
return ucv_boolean_new(true);
|
||||
|
||||
intval = ucv_int64_get(ucv_object_get(info, "center_seg0_idx", NULL));
|
||||
if (!errno)
|
||||
@ -444,6 +552,8 @@ uc_hostapd_iface_start(uc_vm_t *vm, size_t nargs)
|
||||
intval = ucv_int64_get(ucv_object_get(info, "frequency", NULL));
|
||||
if (!errno)
|
||||
iface->freq = intval;
|
||||
else
|
||||
iface->freq = 0;
|
||||
conf->acs = 0;
|
||||
|
||||
out:
|
||||
|
@ -14,6 +14,7 @@ PKG_RELEASE:=1
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://musl.libc.org/releases/
|
||||
PKG_HASH:=7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039
|
||||
PKG_CPE_ID:=cpe:/a:musl-libc:musl
|
||||
|
||||
LIBC_SO_VERSION:=$(PKG_VERSION)
|
||||
PATCH_DIR:=$(PATH_PREFIX)/patches
|
||||
|
Loading…
x
Reference in New Issue
Block a user