From patchwork Wed Mar 6 17:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908951 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=NP7q/nBk; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=GnJQEj1c; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqfqH2J93z23cw for ; Thu, 7 Mar 2024 04:40:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lBZvHJs1gmnD+maDHCX4hiHyPOLEEBZ8xJ1+0GtOpbw=; b=NP7q/nBkmZ7Z8a LxcNtG1TSGsEb9w3TvGHUAFfAX8dIpZe/8+/oInErigzM/mVNPQBw+M8mjEXZcgBhpWZ1FYl1Alb1 h6A8VhJWCMAGy74RgZRpmugmP0GTxgsKEr+JsB8Yq6oMI1Vx6qpVMmD5pRVVOOomyITumdSLoJLgd WXUSVmFhxvv/X5kXg6GKrGon8xbkUQSxNF2lR2pI4xvAVuk9dBRXLOWSilsVh4CUPTV6yfK8i/y1A RoD1kfV6WwjnLCY0FYzwkt1pgKx1B6Qy3wE1g831JYeQiPj3YfWKYjK2TG6CbKo/Pc5SKf6fAo9KU bY4XL/5ThU/M+8JeH76w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFf-00000001Dhb-1t6Z; Wed, 06 Mar 2024 17:40:23 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFb-00000001DfX-2F2M for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:21 +0000 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426CquDv030452 for ; Wed, 6 Mar 2024 17:40:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=HWDQfqXYVgq9xrhtXLYGEkm7TDzA6O9z4zvciKPD9Ek=; b=Gn JQEj1cGjuJpGn6DWvP/vy2PkEgAkNOdC9lQWcrdbLS8g37DddIb/cXZhoNRbNJPq PtWScBdorqueFyfURBfDVT/gBjBQmv2JI4x1GE9VT3HxH6vBjFrSS0D+dTYFmscY E4RgF1N7S32wgKvDrmSMe07c4OqjjNBQSy6JptnjbCFr61OphmXKEFJgPx1hrAs6 oNGl8mbiztvMgpo0VBuRxOSUGOv1WjB0G/JGmfQNPZd3RSLVtarQByLWXFaNar4y AV0ZhpGidxPOoCDo423pdwEee+n5J+JGxwpUj7kNSEl1uwhOzCBNuDEDDxbeWvLO WNIbjtUgeXwFRx/k4IsQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpm4v9b8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:16 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeFEs016924 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:15 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:13 -0800 From: Aditya Kumar Singh To: CC: Sriram R , Aditya Kumar Singh Subject: [PATCH 01/16] hostapd: MLO: avoid usage of mld_id as user configuration Date: Wed, 6 Mar 2024 23:09:32 +0530 Message-ID: <20240306173947.2611965-2-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: vDo7qSBt-8JqoriLkCKelWBAgDHwW84Z X-Proofpoint-GUID: vDo7qSBt-8JqoriLkCKelWBAgDHwW84Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 spamscore=0 impostorscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094019_736115_569019F8 X-CRM114-Status: GOOD ( 26.43 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Sriram R Currently mld_id is provided as a user configuration to identify partner bss belonging to the same MLD. The same id is used at protocol level also to indicate the MLD ID of the MLD. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Sriram R Currently mld_id is provided as a user configuration to identify partner bss belonging to the same MLD. The same id is used at protocol level also to indicate the MLD ID of the MLD. But, in general mld_id is a relative reference of the MLD where 0 is used as the mld_id to represent the self MLD and in case of MLO MBSSID mld_id of a non transmitted BSS affiliated to a MLD is based on the relative bss index of the non transmitted BSS from the transmitted BSS. Hence mld_id need not be fetched from users, rather it can be identified wherever required. To verify if the partners are belonging to the same MLD the interface name can be checked, since all link BSS partners of the same MLD belongs to the same interface. Hence, remove usage of mld_id user config and instead introduce two functions hostapd_is_ml_partner() and hostapd_get_mld_id(). The former is used to verfiy if partneres belong to same MLD or not and the later is used the get the MLD ID of the bss. Signed-off-by: Sriram R Signed-off-by: Aditya Kumar Singh --- hostapd/config_file.c | 2 -- hostapd/ctrl_iface.c | 6 +++--- hostapd/hostapd.conf | 3 --- hostapd/main.c | 10 ++++++++-- src/ap/beacon.c | 5 ++--- src/ap/ctrl_iface_ap.c | 2 +- src/ap/drv_callbacks.c | 2 +- src/ap/hostapd.c | 24 +++++++++++++++++++++--- src/ap/hostapd.h | 6 +++++- src/ap/ieee802_11.c | 16 +++++++--------- src/ap/ieee802_11_eht.c | 6 +++--- src/ap/ieee802_1x.c | 2 +- src/ap/sta_info.c | 4 ++-- src/ap/wpa_auth_glue.c | 4 ++-- 14 files changed, 56 insertions(+), 36 deletions(-) diff --git a/hostapd/config_file.c b/hostapd/config_file.c index d30f2fe9f272..55ec0b2bcb81 100644 --- a/hostapd/config_file.c +++ b/hostapd/config_file.c @@ -5014,8 +5014,6 @@ static int hostapd_config_fill(struct hostapd_config *conf, conf->punct_acs_threshold = val; } else if (os_strcmp(buf, "mld_ap") == 0) { bss->mld_ap = !!atoi(pos); - } else if (os_strcmp(buf, "mld_id") == 0) { - bss->mld_id = atoi(pos); } else if (os_strcmp(buf, "mld_addr") == 0) { if (hwaddr_aton(pos, bss->mld_addr)) { wpa_printf(MSG_ERROR, "Line %d: Invalid mld_addr", diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 8a12fee886db..6f2b31eaf6be 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -3479,7 +3479,7 @@ static int hostapd_ctrl_iface_enable_mld(struct hostapd_iface *iface) struct hostapd_bss_config *h_conf = h_hapd->conf; if (!h_conf->mld_ap || - h_conf->mld_id != iface->bss[0]->conf->mld_id) + !hostapd_is_ml_partner(h_hapd, iface->bss[0])) continue; if (hostapd_enable_iface(h_iface)) { @@ -3520,7 +3520,7 @@ static int hostapd_ctrl_iface_disable_mld(struct hostapd_iface *iface) struct hostapd_bss_config *h_conf = h_hapd->conf; if (!h_conf->mld_ap || - h_conf->mld_id != iface->bss[0]->conf->mld_id) + !hostapd_is_ml_partner(h_hapd, iface->bss[0])) continue; if (!h_hapd->mld_first_bss) { @@ -3541,7 +3541,7 @@ static int hostapd_ctrl_iface_disable_mld(struct hostapd_iface *iface) struct hostapd_bss_config *h_conf = h_hapd->conf; if (!h_conf->mld_ap || - h_conf->mld_id != iface->bss[0]->conf->mld_id || + !hostapd_is_ml_partner(h_hapd, iface->bss[0]) || !h_hapd->mld_first_bss) continue; diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf index f8b4f9c65957..e855ca45792c 100644 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf @@ -1071,9 +1071,6 @@ wmm_ac_vo_acm=0 # 1 = yes (MLO) #mld_ap=0 -# MLD ID - Affiliated MLD ID -#mld_id=1 - # AP MLD MAC address # The configured address will be set as the interface hardware address and used # as the AP MLD MAC address. If not set, the current interface hardware address diff --git a/hostapd/main.c b/hostapd/main.c index c95cf8a71e3d..a7610b8a54f5 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -175,9 +175,15 @@ static int hostapd_driver_init(struct hostapd_iface *iface) continue; } - if (!hconf->mld_ap || hconf->mld_id != conf->mld_id) { + if (!hconf->mld_ap) { wpa_printf(MSG_DEBUG, - "MLD: Skip non matching mld_id"); + "MLD: Skip non MLD"); + continue; + } + + if (!hostapd_is_ml_partner(hapd, h_hapd)) { + wpa_printf(MSG_DEBUG, + "MLD: Skip non matching mld vif name"); continue; } diff --git a/src/ap/beacon.c b/src/ap/beacon.c index e50f0a0c976e..9c028b5b72d6 100644 --- a/src/ap/beacon.c +++ b/src/ap/beacon.c @@ -960,7 +960,7 @@ static void hostapd_fill_probe_resp_ml_params(struct hostapd_data *hapd, * We want to include the AP MLD ID in the response if it was * included in the request. */ - probed_mld_id = mld_id != -1 ? mld_id : hapd->conf->mld_id; + probed_mld_id = mld_id != -1 ? mld_id : hostapd_get_mld_id(hapd); for_each_mld_link(link, i, j, hapd->iface->interfaces, probed_mld_id) { @@ -2675,8 +2675,7 @@ int ieee802_11_set_beacon(struct hostapd_data *hapd) continue; #ifdef CONFIG_IEEE80211BE - if (hapd->conf->mld_ap && other->bss[0]->conf->mld_ap && - hapd->conf->mld_id == other->bss[0]->conf->mld_id) + if (hostapd_is_ml_partner(hapd, other->bss[0])) mld_ap = true; #endif /* CONFIG_IEEE80211BE */ diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c index e65c3c4b2749..cdd777287361 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c @@ -1013,7 +1013,7 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf, "mld_id[%d]=%d\n" "mld_link_id[%d]=%d\n", (int) i, MAC2STR(bss->mld_addr), - (int) i, bss->conf->mld_id, + (int) i, hostapd_get_mld_id(bss), (int) i, bss->mld_link_id); if (os_snprintf_error(buflen - len, ret)) return len; diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 814901977057..3b89c700d33f 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -1965,7 +1965,7 @@ static bool search_mld_sta(struct hostapd_data **p_hapd, const u8 *src) struct hostapd_bss_config *hconf = h_hapd->conf; if (!hconf->mld_ap || - hconf->mld_id != hapd->conf->mld_id) + !hostapd_is_ml_partner(h_hapd, hapd)) continue; h_hapd = hostapd_find_by_sta(h, src, false); diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 0def1b918a01..adb5b001a784 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -3220,8 +3220,7 @@ int hostapd_disable_iface(struct hostapd_iface *hapd_iface) struct hostapd_bss_config *h_conf = h_hapd->conf; if (!h_conf->mld_ap || - h_conf->mld_id != - hapd_iface->bss[0]->conf->mld_id || + !hostapd_is_ml_partner(h_hapd, hapd_iface->bss[0]) || h_iface == hapd_iface) continue; @@ -4415,7 +4414,7 @@ struct hostapd_data * hostapd_mld_get_link_bss(struct hostapd_data *hapd, struct hostapd_data *h_hapd = h->bss[0]; struct hostapd_bss_config *hconf = h_hapd->conf; - if (!hconf->mld_ap || hconf->mld_id != hapd->conf->mld_id) + if (!hconf->mld_ap || !hostapd_is_ml_partner(hapd, h_hapd)) continue; if (h_hapd->mld_link_id == link_id) @@ -4424,4 +4423,23 @@ struct hostapd_data * hostapd_mld_get_link_bss(struct hostapd_data *hapd, return NULL; } + +bool hostapd_is_ml_partner(struct hostapd_data *hapd1, struct hostapd_data *hapd2) +{ + if (!hapd1->conf->mld_ap || !hapd2->conf->mld_ap) + return false; + + return !(os_strcmp(hapd1->conf->iface, hapd2->conf->iface)); +} + +u8 hostapd_get_mld_id(struct hostapd_data *hapd) +{ + if (!hapd->conf->mld_ap) + return 255; + + /* MLD ID 0 represents self */ + return 0; + + /* TODO MLD ID for MBSS cases */ +} #endif /* CONFIG_IEEE80211BE */ diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 22540bb371c1..4c84fb8f56d9 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -783,6 +783,10 @@ struct hostapd_data * hostapd_mld_get_link_bss(struct hostapd_data *hapd, int hostapd_link_remove(struct hostapd_data *hapd, u32 count); #ifdef CONFIG_IEEE80211BE +u8 hostapd_get_mld_id(struct hostapd_data *hapd); +bool hostapd_is_ml_partner(struct hostapd_data *hapd1, + struct hostapd_data *hapd2); + #define for_each_mld_link(_link, _bss_idx, _iface_idx, _ifaces, _mld_id) \ for (_iface_idx = 0; \ _iface_idx < (_ifaces)->count; \ @@ -794,7 +798,7 @@ int hostapd_link_remove(struct hostapd_data *hapd, u32 count); for (_link = \ (_ifaces)->iface[_iface_idx]->bss[_bss_idx]; \ _link && _link->conf->mld_ap && \ - _link->conf->mld_id == _mld_id; \ + hostapd_get_mld_id(_link) == _mld_id; \ _link = NULL) #else /* CONFIG_IEEE80211BE */ #define for_each_mld_link(_link, _bss_idx, _iface_idx, _ifaces, _mld_id) \ diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 41508ff509c0..22f3841752e1 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -4565,7 +4565,7 @@ int hostapd_process_assoc_ml_info(struct hostapd_data *hapd, continue; if (iface->bss[0]->conf->mld_ap && - hapd->conf->mld_id == iface->bss[0]->conf->mld_id && + hostapd_is_ml_partner(hapd, iface->bss[0]) && i == iface->bss[0]->mld_link_id) break; } @@ -5781,7 +5781,7 @@ static bool hostapd_ml_handle_disconnect(struct hostapd_data *hapd, assoc_hapd->iface->interfaces->iface[i]->bss[0]; if (!tmp_hapd->conf->mld_ap || - assoc_hapd->conf->mld_id != tmp_hapd->conf->mld_id) + !hostapd_is_ml_partner(assoc_hapd, tmp_hapd)) continue; for (tmp_sta = tmp_hapd->sta_list; tmp_sta; @@ -6449,7 +6449,7 @@ static void hostapd_ml_handle_assoc_cb(struct hostapd_data *hapd, hapd->iface->interfaces->iface[i]->bss[0]; if (!tmp_hapd->conf->mld_ap || - hapd->conf->mld_id != tmp_hapd->conf->mld_id) + !hostapd_is_ml_partner(tmp_hapd, hapd)) continue; for (tmp_sta = tmp_hapd->sta_list; tmp_sta; @@ -7412,8 +7412,7 @@ static size_t hostapd_eid_rnr_multi_iface_len(struct hostapd_data *hapd, bool ap_mld = false; #ifdef CONFIG_IEEE80211BE - if (hapd->conf->mld_ap && iface->bss[0]->conf->mld_ap && - hapd->conf->mld_id == iface->bss[0]->conf->mld_id) + if (hostapd_is_ml_partner(hapd, iface->bss[0])) ap_mld = true; #endif /* CONFIG_IEEE80211BE */ @@ -7586,10 +7585,10 @@ static bool hostapd_eid_rnr_bss(struct hostapd_data *hapd, u8 param_ch = hapd->eht_mld_bss_param_change; if (reporting_hapd->conf->mld_ap && - bss->conf->mld_id == reporting_hapd->conf->mld_id) + hostapd_is_ml_partner(bss, reporting_hapd)) *eid++ = 0; else - *eid++ = hapd->conf->mld_id; + *eid++ = hostapd_get_mld_id(hapd); *eid++ = hapd->mld_link_id | ((param_ch & 0xF) << 4); *eid = (param_ch >> 4) & 0xF; @@ -7687,8 +7686,7 @@ static u8 * hostapd_eid_rnr_multi_iface(struct hostapd_data *hapd, u8 *eid, bool ap_mld = false; #ifdef CONFIG_IEEE80211BE - if (hapd->conf->mld_ap && iface->bss[0]->conf->mld_ap && - hapd->conf->mld_id == iface->bss[0]->conf->mld_id) + if (hostapd_is_ml_partner(hapd, iface->bss[0])) ap_mld = true; #endif /* CONFIG_IEEE80211BE */ diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c index b599e10433ff..de5855ebe352 100644 --- a/src/ap/ieee802_11_eht.c +++ b/src/ap/ieee802_11_eht.c @@ -513,8 +513,8 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, if (include_mld_id) { wpa_printf(MSG_DEBUG, "MLD: AP MLD ID=0x%x", - hapd->conf->mld_id); - wpabuf_put_u8(buf, hapd->conf->mld_id); + hostapd_get_mld_id(hapd)); + wpabuf_put_u8(buf, hostapd_get_mld_id(hapd)); } if (!mld_info) @@ -1048,7 +1048,7 @@ static int hostapd_mld_validate_assoc_info(struct hostapd_data *hapd, continue; if (other_hapd->conf->mld_ap && - other_hapd->conf->mld_id == hapd->conf->mld_id && + hostapd_is_ml_partner(hapd, other_hapd) && link_id == other_hapd->mld_link_id) break; } diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c index f13c60a9ee1a..42eb5a173e45 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -173,7 +173,7 @@ static void ieee802_1x_ml_set_sta_authorized(struct hostapd_data *hapd, hapd->iface->interfaces->iface[i]->bss[0]; if (!tmp_hapd->conf->mld_ap || - hapd->conf->mld_id != tmp_hapd->conf->mld_id) + !hostapd_is_ml_partner(hapd, tmp_hapd)) continue; for (tmp_sta = tmp_hapd->sta_list; tmp_sta; diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index dc5e3b419034..97ed805ca5c2 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -979,7 +979,7 @@ static bool ap_sta_ml_disconnect(struct hostapd_data *hapd, tmp_hapd = interfaces->iface[i]->bss[0]; if (!tmp_hapd->conf->mld_ap || - assoc_hapd->conf->mld_id != tmp_hapd->conf->mld_id) + !hostapd_is_ml_partner(tmp_hapd, assoc_hapd)) continue; for (tmp_sta = tmp_hapd->sta_list; tmp_sta; @@ -1731,7 +1731,7 @@ static void ap_sta_remove_link_sta(struct hostapd_data *hapd, unsigned int i, j; for_each_mld_link(tmp_hapd, i, j, hapd->iface->interfaces, - hapd->conf->mld_id) { + hostapd_get_mld_id(hapd)) { struct sta_info *tmp_sta; if (hapd == tmp_hapd) diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c index 9ce58f24611a..d23f218351a6 100644 --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c @@ -1557,7 +1557,7 @@ static int hostapd_wpa_auth_get_ml_rsn_info(void *ctx, hapd->iface->interfaces->iface[j]; if (!iface->bss[0]->conf->mld_ap || - hapd->conf->mld_id != iface->bss[0]->conf->mld_id || + !hostapd_is_ml_partner(hapd, iface->bss[0]) || link_id != iface->bss[0]->mld_link_id || !iface->bss[0]->wpa_auth) continue; @@ -1600,7 +1600,7 @@ static int hostapd_wpa_auth_get_ml_key_info(void *ctx, hapd->iface->interfaces->iface[j]; if (!iface->bss[0]->conf->mld_ap || - hapd->conf->mld_id != iface->bss[0]->conf->mld_id || + !hostapd_is_ml_partner(hapd, iface->bss[0]) || link_id != iface->bss[0]->mld_link_id || !iface->bss[0]->wpa_auth) continue; From patchwork Wed Mar 6 17:39:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908949 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=bMvY72BW; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=cVopvqo1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqfqH2RLmz23d3 for ; Thu, 7 Mar 2024 04:40:58 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Gg+4eVRDK/HIw7ww/wG2ad6QL4KjQ9P7JJGOi1u5iTw=; b=bMvY72BWe8Gq5i QClxK8p9V35UdPtGkRN14iJ0j2tEnxUaTdvhjTYzLZqt1kuJk6LfCRxVtrrp8uv3mQQbdn7gwJCU6 WO2YgI/uSgAYE272LZanRHIFObITjxDpaNPil3Z2vxiL9wkn6dAYNncNFhNlvUpP0vJ9E6BY0+aWy Np4ZgxaBIBiKsXTTgkjnAFDbszoPwuaEo72+hK/yq6rOASMLBvLskJNyjtgUksMvbOXBqlLZorcfO +oaVjOR0LKcbJlm/wHBY0bh0Z97EqSQJjQoyBhpZnWZMIIFA7VAAKQ/vzFN01nsU9FPpPK7mqD3/t QLenzxR0zqwYyP1i2i4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFg-00000001Dhy-2b45; Wed, 06 Mar 2024 17:40:24 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFb-00000001Dfd-2ErP for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:21 +0000 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426E522m018871 for ; Wed, 6 Mar 2024 17:40:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=gMyNQxRi+ax1IT0o2SEXRPPqprV+jtQBLUlQAYPo3Aw=; b=cV opvqo1AC2gnSSLL/xAFIosgZSbhBFEG6eK9BTPlBFgwVMov3rQjVUOtjNek7dUqC rRqKYTIqLXkg6GWYUZtX4Iq1uun6EvtvOpVseU19Fg/OEitlIpCTTtG6SGa5Prf6 F1qUnNL5O9Ae7uSavDAVe7Nm3oPADIftub1b1q4AS6olwspyMUk/TBV/AleB+Xq+ NbCfdqbN6yu3LB8SOjIGcrfJGYxYxZzree0ULLKsxBbWlMsWhGaRJJBzI7r3Tmyr 3snQv98ttf4XHtrJ+g+YYuuY1V2u5J0fe84Lc51y3K1/G7SAK9DxBkQXk2XcM6d1 jnGIbXRAshtxjG2fPtSA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpsxhgj04-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:17 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeG1A016818 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:16 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:15 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 02/16] tests: MLD: remove mld_id config Date: Wed, 6 Mar 2024 23:09:33 +0530 Message-ID: <20240306173947.2611965-3-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 9xpcVRJ_cbvDDeAcldITXs8CInqZM3Lv X-Proofpoint-ORIG-GUID: 9xpcVRJ_cbvDDeAcldITXs8CInqZM3Lv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 spamscore=0 impostorscore=0 mlxlogscore=821 priorityscore=1501 malwarescore=0 clxscore=1015 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094019_714752_FA586F6F X-CRM114-Status: GOOD ( 11.81 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: mld_id config is not used any more. Remove its usage from test files Signed-off-by: Aditya Kumar Singh --- tests/hwsim/hostapd.py | 1 - tests/hwsim/test_eht.py | 1 - 2 files changed, 2 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org mld_id config is not used any more. Remove its usage from test files Signed-off-by: Aditya Kumar Singh --- tests/hwsim/hostapd.py | 1 - tests/hwsim/test_eht.py | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py index 754faf62364a..007812274b6b 100644 --- a/tests/hwsim/hostapd.py +++ b/tests/hwsim/hostapd.py @@ -1034,7 +1034,6 @@ def cfg_mld_link_file(ifname, params): f.write("ieee80211be=1\n") f.write("interface=%s\n" % ifname) f.write("mld_ap=1\n") - f.write("mld_id=0\n") for k, v in list(params.items()): f.write("{}={}\n".format(k,v)) diff --git a/tests/hwsim/test_eht.py b/tests/hwsim/test_eht.py index 18ade87e3ad1..1ecde2026cfa 100644 --- a/tests/hwsim/test_eht.py +++ b/tests/hwsim/test_eht.py @@ -1642,7 +1642,6 @@ def test_eht_mld_rrm_beacon_req(dev, apdev): other_ssid = "other" params = eht_mld_ap_wpa2_params(other_ssid, key_mgmt="OWE", mfp="2") params["channel"] = '6' - params["mld_id"] = '1' hapd1 = eht_mld_enable_ap(hapd1_iface, params) # Issue a beacon request for the second AP From patchwork Wed Mar 6 17:39:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908952 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=LyBSb0lw; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=MNcoxz2Q; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqfqH1HqJz1yX4 for ; Thu, 7 Mar 2024 04:40:57 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=p6nwcO8HRM7y5BfwRwA5ZWnr4GG2m41nrCk/dXTcPAo=; b=LyBSb0lwhEZShk 8IwNDFmasJX2nvFRtpQmb5nGgk4CuimqmjWNOziL7u9FvpsXJL3/g14FaMp0pKTMcXtNDDzMwtfxY 997jQU1P2RccORTxkQVxRG5XBTeA/2h4PSXgS042U27tbwOgJ2qutC2kTfiLfSMzDkmsvLeYRvZAW Mwtgm91eu35PVJIthVhNvgAzRkWlIL9gImaTbl1/MwPTUcbg/Ec0y3o2s8K8Dgejwy9Yo5eTUqHZS P7TLVQRu2F3CvcSmCEs2Kuo5tF9uale7mrPy8org3pPSZpsQ8tSaSMaz6gif7fwUfS4ZGazDxzw1z Vndt0MEkZJBEBOxKGAXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFh-00000001DiK-3BmO; Wed, 06 Mar 2024 17:40:25 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFc-00000001DgG-29W9 for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:22 +0000 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426FvH1K017305 for ; Wed, 6 Mar 2024 17:40:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=YZINZzFe9SkZ7nMf+kaqlq5ZyxmZBHjKoPcrjm6oWqk=; b=MN coxz2QEFGXVK2UdQ2GD5hM7y3J7nz1DNUvV0mOv88QcOGMo3py0TuE0cJbWLxgOI HbEI3BWn7a9R3eFAuBEKAPQSp8CUKzLlbe2D+l0OQJ8uxLuvhhQCYKkPnWRGgsM+ yBVgPw+pwfyWxt706qEKLSWuqQ5ffwYKmwwNcXHI3H8pwK0c5SuZ/3zr8afjyu/P C0VgsfQRvb5xhq8sflc2My1pYElpxDGHSCiEBQwlhJ5kKBrQnDxXwkZHkG1KHXds VjC43ay8bhbuwfZoylOS72Ir8bkhY+cbihRYHpQd0AoBBnR3EaWBI2LPqPWGvyph LdzLf6S6OgxXV+a1XocQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpktpsd62-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:19 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeITQ016962 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:18 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:16 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 03/16] hostapd: MLO: add separate MLD level structure Date: Wed, 6 Mar 2024 23:09:34 +0530 Message-ID: <20240306173947.2611965-4-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: mKN62sCLUK3QAcGJECyl6PH4n3wlJh0G X-Proofpoint-ORIG-GUID: mKN62sCLUK3QAcGJECyl6PH4n3wlJh0G X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxlogscore=999 mlxscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094020_703419_90785F5B X-CRM114-Status: GOOD ( 27.38 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently, MLD level info like, MLD address, next link ID, etc are stored in each BSS. However, only first link BSS assign values to these members and rest other stores reference to the first BSS. How [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently, MLD level info like, MLD address, next link ID, etc are stored in each BSS. However, only first link BSS assign values to these members and rest other stores reference to the first BSS. However, if first BSS is disabled, then the first BSS reference in all BSS should be updated which is an overhead. Also, this does not seem to scale. Instead, a separate MLD level structure can be maintained which can store all these ML related information. All affiliated link BSS can keep reference to this MLD structure. This change adds that MLD level structure. However, assigning values to it and using that instead of BSS level members would be done in subsequent changes. Signed-off-by: Aditya Kumar Singh --- hostapd/main.c | 26 ++++++++ src/ap/hostapd.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++ src/ap/hostapd.h | 28 ++++++++ 3 files changed, 220 insertions(+) diff --git a/hostapd/main.c b/hostapd/main.c index a7610b8a54f5..2c0f44719300 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -737,6 +737,28 @@ static int gen_uuid(const char *txt_addr) #define HOSTAPD_CLEANUP_INTERVAL 10 #endif /* HOSTAPD_CLEANUP_INTERVAL */ +#ifdef CONFIG_IEEE80211BE +static void hostapd_global_cleanup_mld(struct hapd_interfaces *interfaces) +{ + size_t i; + + if (!interfaces || !interfaces->mld) + return; + + for (i = 0; i < interfaces->mld_count; i++) { + if (!interfaces->mld[i]) + continue; + + os_free(interfaces->mld[i]); + interfaces->mld[i] = NULL; + } + + os_free(interfaces->mld); + interfaces->mld = NULL; + interfaces->mld_count = 0; +} +#endif /* CONFIG_IEEE80211BE */ + static int hostapd_periodic_call(struct hostapd_iface *iface, void *ctx) { hostapd_periodic_iface(iface); @@ -1035,6 +1057,10 @@ int main(int argc, char *argv[]) interfaces.iface = NULL; interfaces.count = 0; +#ifdef CONFIG_IEEE80211BE + hostapd_global_cleanup_mld(&interfaces); +#endif /* CONFIG_IEEE80211BE */ + #ifdef CONFIG_DPP dpp_global_deinit(interfaces.dpp); #endif /* CONFIG_DPP */ diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index adb5b001a784..f75edaf71692 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -2865,6 +2865,69 @@ struct hostapd_iface * hostapd_alloc_iface(void) return hapd_iface; } +#ifdef CONFIG_IEEE80211BE +static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd, + struct hapd_interfaces *interfaces) +{ + struct hostapd_mld *mld, **all_mld; + struct hostapd_bss_config *conf; + size_t i; + + if (!hapd || !interfaces) + return; + + conf = hapd->conf; + + if (!hapd->iconf || !hapd->iconf->ieee80211be || !conf->mld_ap || + conf->disable_11be) + return; + + for (i = 0; i < interfaces->mld_count; i++) { + mld = interfaces->mld[i]; + + if (!(mld && os_strcmp(conf->iface, mld->name) == 0)) + continue; + + hapd->mld = mld; + break; + } + + if (hapd->mld) + return; + + mld = os_zalloc(sizeof(struct hostapd_mld)); + if (!mld) + goto fail; + + os_strlcpy(mld->name, conf->iface, sizeof(conf->iface)); + mld->next_link_id = 0; + mld->num_links = 0; + mld->fbss = NULL; + dl_list_init(&mld->links); + + wpa_printf(MSG_DEBUG, "MLD %s created", mld->name); + + hapd->mld = mld; + + all_mld = os_realloc_array(interfaces->mld, interfaces->mld_count + 1, + sizeof(struct hostapd_mld *)); + if (!all_mld) + goto fail; + + interfaces->mld = all_mld; + interfaces->mld[interfaces->mld_count] = mld; + interfaces->mld_count++; + + return; +fail: + if (!mld) + return; + + wpa_printf(MSG_DEBUG, "MLD %s: free mld %p", mld->name, mld); + os_free(mld); + hapd->mld = NULL; +} +#endif /* CONFIG_IEEE80211BE */ /** * hostapd_init - Allocate and initialize per-interface data @@ -2909,6 +2972,9 @@ struct hostapd_iface * hostapd_init(struct hapd_interfaces *interfaces, if (hapd == NULL) goto fail; hapd->msg_ctx = hapd; +#ifdef CONFIG_IEEE80211BE + hostapd_bss_setup_multi_link(hapd, interfaces); +#endif /* CONFIG_IEEE80211BE */ } return hapd_iface; @@ -3030,6 +3096,10 @@ hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy, iface->conf->last_bss = bss; iface->bss[iface->num_bss] = hapd; hapd->msg_ctx = hapd; +#ifdef CONFIG_IEEE80211BE + hostapd_bss_setup_multi_link(hapd, interfaces); +#endif /* CONFIG_IEEE80211BE */ + bss_idx = iface->num_bss++; conf->num_bss--; @@ -3371,6 +3441,9 @@ static int hostapd_data_alloc(struct hostapd_iface *hapd_iface, return -1; } hapd->msg_ctx = hapd; +#ifdef CONFIG_IEEE80211BE + hostapd_bss_setup_multi_link(hapd, hapd_iface->interfaces); +#endif /* CONFIG_IEEE80211BE */ } hapd_iface->conf = conf; @@ -4442,4 +4515,97 @@ u8 hostapd_get_mld_id(struct hostapd_data *hapd) /* TODO MLD ID for MBSS cases */ } + +int hostapd_mld_add_link(struct hostapd_data *hapd) +{ + struct hostapd_mld *mld = hapd->mld; + + if (!hapd->conf->mld_ap) + return 0; + + /* should not happen */ + if (!mld) + return -1; + + dl_list_add_tail(&mld->links, &hapd->link); + mld->num_links++; + + wpa_printf(MSG_DEBUG, "MLD %s: Link ID %d added. num_links: %d", + mld->name, hapd->mld_link_id, mld->num_links); + + if (mld->fbss) + return 0; + + mld->fbss = hapd; + wpa_printf(MSG_DEBUG, "MLD %s: First link BSS set to %p", + mld->name, mld->fbss); + return 0; +} + +int hostapd_mld_remove_link(struct hostapd_data *hapd) +{ + struct hostapd_mld *mld = hapd->mld; + struct hostapd_data *next_fbss; + + if (!hapd->conf->mld_ap) + return 0; + + /* should not happen */ + if (!mld) + return -1; + + dl_list_del(&hapd->link); + mld->num_links--; + + wpa_printf(MSG_DEBUG, "MLD %s: Link ID %d removed. num_links: %d", + mld->name, hapd->mld_link_id, mld->num_links); + + if (mld->fbss != hapd) + return 0; + + /* If len is 0, all links are removed */ + if (!dl_list_len(&mld->links)) { + mld->fbss = NULL; + } else { + next_fbss = dl_list_entry(mld->links.next, struct hostapd_data, + link); + mld->fbss = next_fbss; + } + + wpa_printf(MSG_DEBUG, "MLD %s: First link BSS set to %p", + mld->name, mld->fbss); + return 0; +} + +bool hostapd_mld_is_first_bss(struct hostapd_data *hapd) +{ + struct hostapd_mld *mld = hapd->mld; + + if (!hapd->conf->mld_ap) + return 1; + + /* should not happen */ + if (!mld) + return 0; + + /* if fbss is not set, safe to assume the caller is the first BSS */ + if (!mld->fbss) + return 1; + + return hapd == mld->fbss; +} + +struct hostapd_data *hostapd_mld_get_first_bss(struct hostapd_data *hapd) +{ + struct hostapd_mld *mld = hapd->mld; + + if (!hapd->conf->mld_ap) + return NULL; + + /* should not happen */ + if (!mld) + return NULL; + + return mld->fbss; +} #endif /* CONFIG_IEEE80211BE */ diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 4c84fb8f56d9..9aa0651c876f 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -44,6 +44,9 @@ struct mesh_conf; #endif /* CONFIG_CTRL_IFACE_UDP */ struct hostapd_iface; +#ifdef CONFIG_IEEE80211BE +struct hostapd_mld; +#endif /* CONFIG_IEEE80211BE */ struct hapd_interfaces { int (*reload_config)(struct hostapd_iface *iface); @@ -93,6 +96,10 @@ struct hapd_interfaces { unsigned char ctrl_iface_cookie[CTRL_IFACE_COOKIE_LEN]; #endif /* CONFIG_CTRL_IFACE_UDP */ +#ifdef CONFIG_IEEE80211BE + struct hostapd_mld **mld; + size_t mld_count; +#endif /* CONFIG_IEEE80211BE */ }; enum hostapd_chan_status { @@ -472,6 +479,8 @@ struct hostapd_data { #ifdef CONFIG_IEEE80211BE u8 eht_mld_bss_param_change; + struct hostapd_mld *mld; + struct dl_list link; #ifdef CONFIG_TESTING_OPTIONS u8 eht_mld_link_removal_count; #endif /* CONFIG_TESTING_OPTIONS */ @@ -493,6 +502,21 @@ struct hostapd_sta_info { #endif /* CONFIG_TAXONOMY */ }; +#ifdef CONFIG_IEEE80211BE +/** + * struct hostapd_mld - hostapd per-mld data structure + */ +struct hostapd_mld { + char name[IFNAMSIZ + 1]; + u8 mld_addr[ETH_ALEN]; + u8 next_link_id; + u8 num_links; + + struct hostapd_data *fbss; + struct dl_list links; /* List HEAD of all affiliated links */ +}; +#endif /* CONFIG_IEEE80211BE */ + /** * struct hostapd_iface - hostapd per-interface data structure */ @@ -786,6 +810,10 @@ int hostapd_link_remove(struct hostapd_data *hapd, u32 count); u8 hostapd_get_mld_id(struct hostapd_data *hapd); bool hostapd_is_ml_partner(struct hostapd_data *hapd1, struct hostapd_data *hapd2); +int hostapd_mld_add_link(struct hostapd_data *hapd); +int hostapd_mld_remove_link(struct hostapd_data *hapd); +bool hostapd_mld_is_first_bss(struct hostapd_data *hapd); +struct hostapd_data *hostapd_mld_get_first_bss(struct hostapd_data *hapd); #define for_each_mld_link(_link, _bss_idx, _iface_idx, _ifaces, _mld_id) \ for (_iface_idx = 0; \ From patchwork Wed Mar 6 17:39:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908957 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=m76uRtX/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=hXWhZc5w; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqfqM4j2xz1yX4 for ; Thu, 7 Mar 2024 04:41:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2bAy4sl//VrjxWfulbpeqFlq5+/kaLzpVNNHBRMAXpc=; b=m76uRtX/kAhqGw gsvZo4YV6WboB5wGE7r6i+RDA7UcUBdybxMLAZi8yAUJFTD698UmVzT4cIVMSfs+NfK33W3ETyJM0 RxTas5ddLuOc1UducYliOsikF53456T1O3kFA6i4H7XeHyiQLXVWAmhWQVs/Cbg5r7Sn6zDLKXDh2 tHBRLC4E5W5RT3bpkA30mM2gajyNi4Oh9ym0ekKd/4cDRw+z58CpvRGF2S6yt27IgTOzUPcEieMnY dbqcA/ZEh5Fsje1iRfSWsFul6AnEffjKTaUUM28IYtcSshrSce39Aq3RbE6eNIO5bo35iJHNi87f2 DKVKWI/1Ygp1oHpN+pRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFj-00000001Dj5-1wJr; Wed, 06 Mar 2024 17:40:27 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFd-00000001Dh6-3HKX for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:24 +0000 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426HRPtB010030 for ; Wed, 6 Mar 2024 17:40:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=BtGeL3UiMXyAI1/wIrofm/M8GMMUf24quYJS3+QTjLk=; b=hX WhZc5wRJ3HNY5Di25Vgootdc6dG0nqItNK48sJVxD5bBbdR1wzPM5qGS/x/EH1Wd LD7uGnVEx0sTAoQNGXaXbfGQ5HN8n3TxCzNBDkto9iE9iPcYd+gbz7rlNWg+sZnt OxD24sCweoMdQdi12Hi5UWJOJJbUTK6D92X3SDTSdaQn/87ZD0NRcOjOBQhjiBhA zO1577a0tM9gB5WnVt2QhJyYsNCtvbNN280hA76Ey+76mFYp3OzYUKU54cLfqn4X eMpJPcHwArkoDP5iYjg5RTwN4ik6NfAzV/RyFEBqcDM8nGyK7eidsDsFDwPRlAti OL/+W7TDtGqbEIBjdN3w== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpvw600wj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:21 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeKa1012230 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:20 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:18 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 04/16] hostapd: MLO: use MLD struct for MLD level info Date: Wed, 6 Mar 2024 23:09:35 +0530 Message-ID: <20240306173947.2611965-5-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: YTEOlxukms5I-xE8EVZVsV7gW3OT2T-r X-Proofpoint-ORIG-GUID: YTEOlxukms5I-xE8EVZVsV7gW3OT2T-r X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 bulkscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094022_361552_4D251DF3 X-CRM114-Status: GOOD ( 30.08 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: MLD level structure is present to store the MLD level info. Add changes to use MLD structure instead of its own BSS to get/set the MLD level info. Signed-off-by: Aditya Kumar Singh --- hostapd/ctrl_iface.c | 6 ++-- hostapd/main.c | 21 +++++------ src/ap/ap_drv_ops.c | 6 ++-- src/ap/authsrv.c | 20 +++++++---- src/ap/ctrl_ [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org MLD level structure is present to store the MLD level info. Add changes to use MLD structure instead of its own BSS to get/set the MLD level info. Signed-off-by: Aditya Kumar Singh --- hostapd/ctrl_iface.c | 6 ++-- hostapd/main.c | 21 +++++------ src/ap/ap_drv_ops.c | 6 ++-- src/ap/authsrv.c | 20 +++++++---- src/ap/ctrl_iface_ap.c | 2 +- src/ap/drv_callbacks.c | 6 ++-- src/ap/hostapd.c | 73 +++++++++++++++++++++++++++++++++----- src/ap/hostapd.h | 7 +--- src/ap/ieee802_11.c | 22 +++++++----- src/ap/ieee802_11_eht.c | 4 +-- src/ap/ieee802_11_shared.c | 4 +-- src/ap/ieee802_1x.c | 10 ++++-- src/ap/wnm_ap.c | 2 +- 13 files changed, 122 insertions(+), 61 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 6f2b31eaf6be..714d09837605 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -1944,7 +1944,7 @@ static int hostapd_ctrl_iface_data_test_config(struct hostapd_data *hapd, #ifdef CONFIG_IEEE80211BE if (hapd->conf->mld_ap) - addr = hapd->mld_addr; + addr = hapd->mld->mld_addr; #endif /* CONFIG_IEEE80211BE */ hapd->l2_test = l2_packet_init(ifname, addr, ETHERTYPE_IP, hostapd_data_test_rx, @@ -3523,7 +3523,7 @@ static int hostapd_ctrl_iface_disable_mld(struct hostapd_iface *iface) !hostapd_is_ml_partner(h_hapd, iface->bss[0])) continue; - if (!h_hapd->mld_first_bss) { + if (hostapd_mld_is_first_bss(h_hapd)) { first_iface = h_iface; continue; } @@ -3542,7 +3542,7 @@ static int hostapd_ctrl_iface_disable_mld(struct hostapd_iface *iface) if (!h_conf->mld_ap || !hostapd_is_ml_partner(h_hapd, iface->bss[0]) || - !h_hapd->mld_first_bss) + hostapd_mld_is_first_bss(h_hapd)) continue; if (hostapd_disable_iface(h_iface)) { diff --git a/hostapd/main.c b/hostapd/main.c index 2c0f44719300..6df7868c778b 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -204,20 +204,15 @@ static int hostapd_driver_init(struct hostapd_iface *iface) * is not configured, and otherwise it would be the * configured BSSID. */ - os_memcpy(hapd->mld_addr, h_hapd->mld_addr, ETH_ALEN); if (is_zero_ether_addr(b)) { - os_memcpy(hapd->own_addr, h_hapd->mld_addr, ETH_ALEN); + os_memcpy(hapd->own_addr, h_hapd->mld->mld_addr, ETH_ALEN); random_mac_addr_keep_oui(hapd->own_addr); } else { os_memcpy(hapd->own_addr, b, ETH_ALEN); } - /* - * Mark the interface as a secondary interface, as this - * is needed for the de-initialization flow - */ - hapd->mld_first_bss = h_hapd; - hapd->mld_link_id = hapd->mld_first_bss->mld_next_link_id++; + hapd->mld_link_id = hapd->mld->next_link_id++; + hostapd_mld_add_link(hapd); goto setup_mld; } @@ -294,13 +289,15 @@ static int hostapd_driver_init(struct hostapd_iface *iface) * configured, and otherwise it would be the configured BSSID. */ if (hapd->conf->mld_ap) { - os_memcpy(hapd->mld_addr, hapd->own_addr, ETH_ALEN); - hapd->mld_next_link_id = 0; - hapd->mld_link_id = hapd->mld_next_link_id++; + os_memcpy(hapd->mld->mld_addr, hapd->own_addr, ETH_ALEN); + if (!b) random_mac_addr_keep_oui(hapd->own_addr); else os_memcpy(hapd->own_addr, b, ETH_ALEN); + + hapd->mld_link_id = hapd->mld->next_link_id++; + hostapd_mld_add_link(hapd); } setup_mld: @@ -354,7 +351,7 @@ setup_mld: wpa_printf(MSG_DEBUG, "MLD: Set link_id=%u, mld_addr=" MACSTR ", own_addr=" MACSTR, - hapd->mld_link_id, MAC2STR(hapd->mld_addr), + hapd->mld_link_id, MAC2STR(hapd->mld->mld_addr), MAC2STR(hapd->own_addr)); hostapd_drv_link_add(hapd, hapd->mld_link_id, diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index 60d66e4c0888..a6f53fd8cbb1 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -840,7 +840,7 @@ int hostapd_drv_sta_deauth(struct hostapd_data *hapd, link_id = hapd->mld_link_id; if (ap_sta_is_mld(hapd, sta)) - own_addr = hapd->mld_addr; + own_addr = hapd->mld->mld_addr; } #endif /* CONFIG_IEEE80211BE */ @@ -861,7 +861,7 @@ int hostapd_drv_sta_disassoc(struct hostapd_data *hapd, struct sta_info *sta = ap_get_sta(hapd, addr); if (ap_sta_is_mld(hapd, sta)) - own_addr = hapd->mld_addr; + own_addr = hapd->mld->mld_addr; } #endif /* CONFIG_IEEE80211BE */ @@ -919,7 +919,7 @@ static int hapd_drv_send_action(struct hostapd_data *hapd, unsigned int freq, sta = ap_get_sta(hapd, dst); if (ap_sta_is_mld(hapd, sta)) { - own_addr = hapd->mld_addr; + own_addr = hapd->mld->mld_addr; bssid = own_addr; } #endif /* CONFIG_IEEE80211BE */ diff --git a/src/ap/authsrv.c b/src/ap/authsrv.c index 1488dccc3d7f..3a3514e93b82 100644 --- a/src/ap/authsrv.c +++ b/src/ap/authsrv.c @@ -107,13 +107,15 @@ static int hostapd_setup_radius_srv(struct hostapd_data *hapd) struct radius_server_conf srv; struct hostapd_bss_config *conf = hapd->conf; - if (hapd->mld_first_bss) { +#ifdef CONFIG_IEEE80211BE + if (!hostapd_mld_is_first_bss(hapd)) { wpa_printf(MSG_DEBUG, "MLD: Using RADIUS server of the first BSS"); - hapd->radius_srv = hapd->mld_first_bss->radius_srv; + hapd->radius_srv = hostapd_mld_get_first_bss(hapd)->radius_srv; return 0; } +#endif /* CONFIG_IEEE80211BE */ os_memset(&srv, 0, sizeof(srv)); srv.client_file = conf->radius_server_clients; @@ -249,18 +251,20 @@ static struct eap_config * authsrv_eap_config(struct hostapd_data *hapd) int authsrv_init(struct hostapd_data *hapd) { - if (hapd->mld_first_bss) { +#ifdef CONFIG_IEEE80211BE + if (!hostapd_mld_is_first_bss(hapd)) { wpa_printf(MSG_DEBUG, "MLD: Using auth_serv of the first BSS"); #ifdef EAP_TLS_FUNCS - hapd->ssl_ctx = hapd->mld_first_bss->ssl_ctx; + hapd->ssl_ctx = hostapd_mld_get_first_bss(hapd)->ssl_ctx; #endif /* EAP_TLS_FUNCS */ - hapd->eap_cfg = hapd->mld_first_bss->eap_cfg; + hapd->eap_cfg = hostapd_mld_get_first_bss(hapd)->eap_cfg; #ifdef EAP_SIM_DB - hapd->eap_sim_db_priv = hapd->mld_first_bss->eap_sim_db_priv; + hapd->eap_sim_db_priv = hostapd_mld_get_first_bss(hapd)->eap_sim_db_priv; #endif /* EAP_SIM_DB */ return 0; } +#endif /* CONFIG_IEEE80211BE */ #ifdef EAP_TLS_FUNCS if (hapd->conf->eap_server && @@ -376,7 +380,8 @@ int authsrv_init(struct hostapd_data *hapd) void authsrv_deinit(struct hostapd_data *hapd) { - if (hapd->mld_first_bss) { +#ifdef CONFIG_IEEE80211BE + if (!hostapd_mld_is_first_bss(hapd)) { wpa_printf(MSG_DEBUG, "MLD: Deinit auth_serv of a non-first BSS"); @@ -390,6 +395,7 @@ void authsrv_deinit(struct hostapd_data *hapd) #endif /* EAP_TLS_FUNCS */ return; } +#endif /* CONFIG_IEEE80211BE */ #ifdef RADIUS_SERVER radius_server_deinit(hapd->radius_srv); diff --git a/src/ap/ctrl_iface_ap.c b/src/ap/ctrl_iface_ap.c index cdd777287361..2723177740b0 100644 --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c @@ -1012,7 +1012,7 @@ int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf, "mld_addr[%d]=" MACSTR "\n" "mld_id[%d]=%d\n" "mld_link_id[%d]=%d\n", - (int) i, MAC2STR(bss->mld_addr), + (int) i, MAC2STR(bss->mld->mld_addr), (int) i, hostapd_get_mld_id(bss), (int) i, bss->mld_link_id); if (os_snprintf_error(buflen - len, ret)) diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 3b89c700d33f..021b79e9f637 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -517,7 +517,7 @@ int hostapd_notif_assoc(struct hostapd_data *hapd, const u8 *addr, if (ap_sta_is_mld(hapd, sta)) { wpa_printf(MSG_DEBUG, "MLD: Set ML info in RSN Authenticator"); - wpa_auth_set_ml_info(sta->wpa_sm, hapd->mld_addr, + wpa_auth_set_ml_info(sta->wpa_sm, hapd->mld->mld_addr, sta->mld_assoc_link_id, &sta->mld_info); } @@ -1815,7 +1815,7 @@ static int hostapd_mgmt_rx(struct hostapd_data *hapd, struct rx_mgmt *rx_mgmt) #ifdef CONFIG_IEEE80211BE if (hapd->conf->mld_ap && - ether_addr_equal(hapd->mld_addr, bssid)) + ether_addr_equal(hapd->mld->mld_addr, bssid)) is_mld = true; #endif /* CONFIG_IEEE80211BE */ @@ -1887,7 +1887,7 @@ static void hostapd_mgmt_tx_cb(struct hostapd_data *hapd, const u8 *buf, hapd = tmp_hapd; #ifdef CONFIG_IEEE80211BE } else if (hapd->conf->mld_ap && - ether_addr_equal(hapd->mld_addr, get_hdr_bssid(hdr, len))) { + ether_addr_equal(hapd->mld->mld_addr, get_hdr_bssid(hdr, len))) { /* AP MLD address match - use hapd pointer as-is */ #endif /* CONFIG_IEEE80211BE */ } else { diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index f75edaf71692..13b2873c6cbf 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -399,6 +399,7 @@ static int hostapd_broadcast_wep_set(struct hostapd_data *hapd) static void hostapd_clear_drv_priv(struct hostapd_data *hapd) { +#ifdef CONFIG_IEEE80211BE unsigned int i; for (i = 0; i < hapd->iface->interfaces->count; i++) { @@ -408,9 +409,10 @@ static void hostapd_clear_drv_priv(struct hostapd_data *hapd) continue; if (iface->bss && iface->bss[0] && - iface->bss[0]->mld_first_bss == hapd) + hostapd_mld_get_first_bss(iface->bss[0]) == hapd) iface->bss[0]->drv_priv = NULL; } +#endif /* CONFIG_IEEE80211BE */ hapd->drv_priv = NULL; } @@ -498,7 +500,8 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd) vlan_deinit(hapd); hostapd_acl_deinit(hapd); #ifndef CONFIG_NO_RADIUS - if (!hapd->mld_first_bss) { +#ifdef CONFIG_IEEE80211BE + if (hostapd_mld_is_first_bss(hapd)) { struct hapd_interfaces *ifaces = hapd->iface->interfaces; size_t i; @@ -517,9 +520,12 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd) h->radius_das = NULL; } } +#endif /* CONFIG_IEEE80211BE */ radius_client_deinit(hapd->radius); radius_das_deinit(hapd->radius_das); +#ifdef CONFIG_IEEE80211BE } +#endif /* CONFIG_IEEE80211BE */ hapd->radius = NULL; hapd->radius_das = NULL; #endif /* CONFIG_NO_RADIUS */ @@ -615,6 +621,39 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd) #endif /* CONFIG_IEEE80211AX */ } +/* hostapd_bss_link_deinit - Per-BSS ML cleanup (deinitialization) + * @hapd: Pointer to BSS data + * + * This function is used to unlink the BSS from the MLD. + * If the BSS being removed is the first link, then the next link + * becomes the first BSS + */ +static void hostapd_bss_link_deinit(struct hostapd_data *hapd) +{ +#ifdef CONFIG_IEEE80211BE + if (!hapd->conf || !hapd->conf->mld_ap) + return; + + if (!hapd->mld->num_links) + return; + + /* if not started then not yet linked to the MLD. However, first + * BSS, is always linked since it is linked during driver_init(), + * hence need to remove it from MLD + */ + if (!hapd->started && hapd->iface->bss[0] != hapd) + return; + + /* first BSS can also be only linked when at least driver_init() is + * executd. But, if previous interface fails, then it will not, + * hence safe to skip + */ + if (hapd->iface->bss[0] == hapd && !hapd->drv_priv) + return; + + hostapd_mld_remove_link(hapd); +#endif +} /** * hostapd_cleanup - Per-BSS cleanup (deinitialization) @@ -1305,9 +1344,11 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first, u8 if_addr[ETH_ALEN]; int flush_old_stations = 1; - if (hapd->mld_first_bss) +#ifdef CONFIG_IEEE80211BE + if (!hostapd_mld_is_first_bss(hapd)) wpa_printf(MSG_DEBUG, "MLD: %s: Setting non-first BSS", __func__); +#endif /* CONFIG_IEEE80211BE */ wpa_printf(MSG_DEBUG, "%s(hapd=%p (%s), first=%d)", __func__, hapd, conf->iface, first); @@ -1467,7 +1508,9 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first, } #endif /* CONFIG_SQLITE */ - if (!hapd->mld_first_bss) { +#ifdef CONFIG_IEEE80211BE + if (hostapd_mld_is_first_bss(hapd)) { +#endif /* CONFIG_IEEE80211BE */ hapd->radius = radius_client_init(hapd, conf->radius); if (!hapd->radius) { wpa_printf(MSG_ERROR, @@ -1499,12 +1542,14 @@ static int hostapd_setup_bss(struct hostapd_data *hapd, int first, return -1; } } +#ifdef CONFIG_IEEE80211BE } else { wpa_printf(MSG_DEBUG, "MLD: Using RADIUS client of the first BSS"); - hapd->radius = hapd->mld_first_bss->radius; - hapd->radius_das = hapd->mld_first_bss->radius_das; + hapd->radius = hostapd_mld_get_first_bss(hapd)->radius; + hapd->radius_das = hostapd_mld_get_first_bss(hapd)->radius_das; } +#endif /* CONFIG_IEEE80211BE */ #endif /* CONFIG_NO_RADIUS */ if (hostapd_acl_init(hapd)) { @@ -1741,6 +1786,7 @@ static int start_ctrl_iface(struct hostapd_iface *iface) static void hostapd_no_ir_cleanup(struct hostapd_data *bss) { hostapd_bss_deinit_no_free(bss); + hostapd_bss_link_deinit(bss); hostapd_free_hapd_data(bss); hostapd_cleanup_iface_partial(bss->iface); } @@ -2799,6 +2845,8 @@ static void hostapd_bss_deinit(struct hostapd_data *hapd) hapd->rad_attr_db = NULL; } #endif /* CONFIG_SQLITE */ + + hostapd_bss_link_deinit(hapd); hostapd_cleanup(hapd); } @@ -3150,7 +3198,9 @@ void hostapd_interface_deinit_free(struct hostapd_iface *iface) wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); if (driver && driver->hapd_deinit && drv_priv) { - if (!iface->bss[0]->mld_first_bss) +#ifdef CONFIG_IEEE80211BE + if (hostapd_mld_is_first_bss(iface->bss[0])) +#endif /* CONFIG_IEEE80211BE */ driver->hapd_deinit(drv_priv); hostapd_clear_drv_priv(iface->bss[0]); } @@ -3167,7 +3217,9 @@ static void hostapd_deinit_driver(const struct wpa_driver_ops *driver, wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); if (driver && driver->hapd_deinit && drv_priv) { - if (!hapd_iface->bss[0]->mld_first_bss) +#ifdef CONFIG_IEEE80211BE + if (hostapd_mld_is_first_bss(hapd_iface->bss[0])) +#endif /* CONFIG_IEEE80211BE */ driver->hapd_deinit(drv_priv); for (j = 0; j < hapd_iface->num_bss; j++) { wpa_printf(MSG_DEBUG, "%s:bss[%d]->drv_priv=%p", @@ -3281,7 +3333,7 @@ int hostapd_disable_iface(struct hostapd_iface *hapd_iface) #ifdef CONFIG_IEEE80211BE if (hapd_iface->bss[0]->conf->mld_ap && - !hapd_iface->bss[0]->mld_first_bss) { + hostapd_mld_is_first_bss((hapd_iface->bss[0]))) { /* Do not allow mld_first_bss disabling before other BSSs */ for (j = 0; j < hapd_iface->interfaces->count; ++j) { struct hostapd_iface *h_iface = @@ -3320,6 +3372,7 @@ int hostapd_disable_iface(struct hostapd_iface *hapd_iface) for (j = 0; j < hapd_iface->num_bss; j++) { struct hostapd_data *hapd = hapd_iface->bss[j]; hostapd_bss_deinit_no_free(hapd); + hostapd_bss_link_deinit(hapd); hostapd_free_hapd_data(hapd); } @@ -3517,6 +3570,7 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) if (start_ctrl_iface_bss(hapd) < 0 || (hapd_iface->state == HAPD_IFACE_ENABLED && hostapd_setup_bss(hapd, -1, true))) { + hostapd_bss_link_deinit(hapd); hostapd_cleanup(hapd); hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; hapd_iface->conf->num_bss--; @@ -3614,6 +3668,7 @@ fail: wpa_printf(MSG_DEBUG, "%s: free hapd %p (%s)", __func__, hapd_iface->bss[i], hapd->conf->iface); + hostapd_bss_link_deinit(hapd); hostapd_cleanup(hapd); os_free(hapd); hapd_iface->bss[i] = NULL; diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 9aa0651c876f..ec090cbbaa85 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -182,12 +182,6 @@ struct hostapd_data { unsigned int reenable_beacon:1; u8 own_addr[ETH_ALEN]; - u8 mld_addr[ETH_ALEN]; - u8 mld_link_id; - /* Used for mld_link_id assignment - valid on the first MLD BSS only */ - u8 mld_next_link_id; - - struct hostapd_data *mld_first_bss; int num_sta; /* number of entries in sta_list */ struct sta_info *sta_list; /* STA info list head */ @@ -481,6 +475,7 @@ struct hostapd_data { u8 eht_mld_bss_param_change; struct hostapd_mld *mld; struct dl_list link; + u8 mld_link_id; #ifdef CONFIG_TESTING_OPTIONS u8 eht_mld_link_removal_count; #endif /* CONFIG_TESTING_OPTIONS */ diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 22f3841752e1..c246b5a9c4cc 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -409,7 +409,7 @@ static int send_auth_reply(struct hostapd_data *hapd, struct sta_info *sta, * the addresses. */ if (ap_sta_is_mld(hapd, sta)) { - sa = hapd->mld_addr; + sa = hapd->mld->mld_addr; ml_resp = hostapd_ml_auth_resp(hapd); if (!ml_resp) @@ -610,7 +610,7 @@ static struct wpabuf * auth_build_sae_commit(struct hostapd_data *hapd, #ifdef CONFIG_IEEE80211BE if (ap_sta_is_mld(hapd, sta)) - own_addr = hapd->mld_addr; + own_addr = hapd->mld->mld_addr; #endif /* CONFIG_IEEE80211BE */ if (sta->sae->tmp) { @@ -2806,7 +2806,9 @@ static void handle_auth(struct hostapd_data *hapd, u16 seq_ctrl; struct radius_sta rad_info; const u8 *dst, *sa, *bssid; +#ifdef CONFIG_IEEE80211BE bool mld_sta = false; +#endif /* CONFIG_IEEE80211BE */ if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", @@ -2924,15 +2926,17 @@ static void handle_auth(struct hostapd_data *hapd, goto fail; } +#ifdef CONFIG_IEEE80211BE if (mld_sta && (ether_addr_equal(sa, hapd->own_addr) || - ether_addr_equal(sa, hapd->mld_addr))) { + ether_addr_equal(sa, hapd->mld->mld_addr))) { wpa_printf(MSG_INFO, "Station " MACSTR " not allowed to authenticate", MAC2STR(sa)); resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } +#endif /* CONFIG_IEEE80211BE */ if (hapd->conf->no_auth_if_seen_on) { struct hostapd_data *other; @@ -3255,7 +3259,7 @@ static void handle_auth(struct hostapd_data *hapd, */ if (ap_sta_is_mld(hapd, sta)) { dst = sta->addr; - bssid = hapd->mld_addr; + bssid = hapd->mld->mld_addr; } #endif /* CONFIG_IEEE80211BE */ @@ -3745,7 +3749,7 @@ u16 owe_process_rsn_ie(struct hostapd_data *hapd, } #ifdef CONFIG_IEEE80211BE if (ap_sta_is_mld(hapd, sta)) - wpa_auth_set_ml_info(sta->wpa_sm, hapd->mld_addr, + wpa_auth_set_ml_info(sta->wpa_sm, hapd->mld->mld_addr, sta->mld_assoc_link_id, &sta->mld_info); #endif /* CONFIG_IEEE80211BE */ rsn_ie -= 2; @@ -4030,7 +4034,7 @@ static int __check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta, wpa_printf(MSG_DEBUG, "MLD: Set ML info in RSN Authenticator"); wpa_auth_set_ml_info(sta->wpa_sm, - hapd->mld_addr, + hapd->mld->mld_addr, sta->mld_assoc_link_id, info); } @@ -4792,7 +4796,7 @@ static u16 send_assoc_resp(struct hostapd_data *hapd, struct sta_info *sta, * MLD MAC address. */ if (ap_sta_is_mld(hapd, sta) && allow_mld_addr_trans) - sa = hapd->mld_addr; + sa = hapd->mld->mld_addr; #endif /* CONFIG_IEEE80211BE */ os_memcpy(reply->da, addr, ETH_ALEN); @@ -6211,7 +6215,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, #endif /* CONFIG_MESH */ #ifdef CONFIG_IEEE80211BE !(hapd->conf->mld_ap && - ether_addr_equal(hapd->mld_addr, mgmt->bssid)) && + ether_addr_equal(hapd->mld->mld_addr, mgmt->bssid)) && #endif /* CONFIG_IEEE80211BE */ !ether_addr_equal(mgmt->bssid, hapd->own_addr)) { wpa_printf(MSG_INFO, "MGMT: BSSID=" MACSTR " not our address", @@ -6234,7 +6238,7 @@ int ieee802_11_mgmt(struct hostapd_data *hapd, const u8 *buf, size_t len, stype != WLAN_FC_STYPE_ACTION) && #ifdef CONFIG_IEEE80211BE !(hapd->conf->mld_ap && - ether_addr_equal(hapd->mld_addr, mgmt->bssid)) && + ether_addr_equal(hapd->mld->mld_addr, mgmt->bssid)) && #endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_NAN_USD !ether_addr_equal(mgmt->da, nan_network_id) && diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c index de5855ebe352..826edc5029d8 100644 --- a/src/ap/ieee802_11_eht.c +++ b/src/ap/ieee802_11_eht.c @@ -495,7 +495,7 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, wpabuf_put_u8(buf, common_info_len); /* Own MLD MAC Address */ - wpabuf_put_data(buf, hapd->mld_addr, ETH_ALEN); + wpabuf_put_data(buf, hapd->mld->mld_addr, ETH_ALEN); /* Own Link ID */ wpabuf_put_u8(buf, hapd->mld_link_id); @@ -812,7 +812,7 @@ struct wpabuf * hostapd_ml_auth_resp(struct hostapd_data *hapd) wpabuf_put_u8(buf, WLAN_EID_EXT_MULTI_LINK); wpabuf_put_le16(buf, MULTI_LINK_CONTROL_TYPE_BASIC); wpabuf_put_u8(buf, ETH_ALEN + 1); - wpabuf_put_data(buf, hapd->mld_addr, ETH_ALEN); + wpabuf_put_data(buf, hapd->mld->mld_addr, ETH_ALEN); return buf; } diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c index 0c38483a98c1..a5716f0379b5 100644 --- a/src/ap/ieee802_11_shared.c +++ b/src/ap/ieee802_11_shared.c @@ -121,7 +121,7 @@ void ieee802_11_send_sa_query_req(struct hostapd_data *hapd, #ifdef CONFIG_IEEE80211BE if (ap_sta_is_mld(hapd, sta)) - own_addr = hapd->mld_addr; + own_addr = hapd->mld->mld_addr; #endif /* CONFIG_IEEE80211BE */ mgmt->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT, @@ -219,7 +219,7 @@ static void ieee802_11_send_sa_query_resp(struct hostapd_data *hapd, #ifdef CONFIG_IEEE80211BE if (ap_sta_is_mld(hapd, sta)) - own_addr = hapd->mld_addr; + own_addr = hapd->mld->mld_addr; #endif /* CONFIG_IEEE80211BE */ resp->frame_control = IEEE80211_FC(WLAN_FC_TYPE_MGMT, diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c index 42eb5a173e45..876f9e39dd45 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -2540,13 +2540,15 @@ int ieee802_1x_init(struct hostapd_data *hapd) struct eapol_auth_config conf; struct eapol_auth_cb cb; - if (hapd->mld_first_bss) { +#ifdef CONFIG_IEEE80211BE + if (!hostapd_mld_is_first_bss(hapd)) { wpa_printf(MSG_DEBUG, "MLD: Using IEEE 802.1X state machine of the first BSS"); - hapd->eapol_auth = hapd->mld_first_bss->eapol_auth; + hapd->eapol_auth = hostapd_mld_get_first_bss(hapd)->eapol_auth; return 0; } +#endif /* CONFIG_IEEE80211BE */ dl_list_init(&hapd->erp_keys); @@ -2632,13 +2634,15 @@ void ieee802_1x_erp_flush(struct hostapd_data *hapd) void ieee802_1x_deinit(struct hostapd_data *hapd) { - if (hapd->mld_first_bss) { +#ifdef CONFIG_IEEE80211BE + if (!hostapd_mld_is_first_bss(hapd)) { wpa_printf(MSG_DEBUG, "MLD: Deinit IEEE 802.1X state machine of a non-first BSS"); hapd->eapol_auth = NULL; return; } +#endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_WEP eloop_cancel_timeout(ieee802_1x_rekey, hapd, NULL); diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c index b77e21bd15e3..af8cccaefcde 100644 --- a/src/ap/wnm_ap.c +++ b/src/ap/wnm_ap.c @@ -51,7 +51,7 @@ static const u8 * wnm_ap_get_own_addr(struct hostapd_data *hapd, #ifdef CONFIG_IEEE80211BE if (hapd->conf->mld_ap && (!sta || ap_sta_is_mld(hapd, sta))) - own_addr = hapd->mld_addr; + own_addr = hapd->mld->mld_addr; #endif /* CONFIG_IEEE80211BE */ return own_addr; From patchwork Wed Mar 6 17:39:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908953 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=iGpWvJnq; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=b4fFxLgP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqfqH1ddjz1yXC for ; Thu, 7 Mar 2024 04:40:57 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=H3lNQqu4eCqedbk5Bs+b7XY1Z95aw9r/OHNlerCWb/c=; b=iGpWvJnqDgD6XO Xh+9x6Sy4GuwxosJFsBMlE+Mlf1v8SDrwAkhe1RXbHYY/pH58rylOHRheb0AWwVyyH0/muzbduJqk WpYQFI9XfzTfUCpAwIu/vMwwDhNd87vqXCrbyy70gReK+NEjD+cENJrDLDmHDpeZ/bF0Kr4ICGcQw lYycK7F4bvMOIzM79JrzbIGKoIZKPRrD0hD7tIV48YPB4h5UwLd735dWS0yrq5KDX+JjQiy6SDiMH EOvFmV+9Rcw2Ec7f8N0nLAqtUZTy4H+pFtHam2bzpKq5RAc1JxYMNUTqhyaXHzHfj/92p7kf+ZwfM bKuMFaXc+79/b4a7eTdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFm-00000001Dkk-35nB; Wed, 06 Mar 2024 17:40:30 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFg-00000001Dhj-0tMK for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:25 +0000 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426EF3w3005926 for ; Wed, 6 Mar 2024 17:40:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=zJicGfjeNs0pwGq0tDsOMser9S585BWiTiGSFkyrSPc=; b=b4 fFxLgPUaVJExi+j5Igz8sHMnj2UgDyDJ9Lf6qJ/42pV7WrVg33zkLy3LoQH9Zwq4 D/WkQllvaoXGFHpeteIy1r3unvrXh6Un5gJNiavsOQV9x1BvxSRmw/kIsJE6HSc4 cAOMwd89mS8YFS1wAWnZnhLTIjvjMr90I1AjebYIm72+unTKJX/Su64qwblAkXjP j2b7OUT3tJmRJAF0d5z9ngOYwaZn+DektJnqrh3KG+dYpIwSCUjsUShw9S396bQ2 JIaDZXCjJFZYzYozYcWcw+jOlYmoYw/5htWkGr+dYmOh830T5tKFaHnh8tOP/qmS SU8ZhIMMzA8dH9axLF0Q== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpjy3sfqu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:23 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeMbY031912 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:22 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:20 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 05/16] hostapd: MLO: assign link ID during BSS creation Date: Wed, 6 Mar 2024 23:09:36 +0530 Message-ID: <20240306173947.2611965-6-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: jN2H8cDFOqBvtQ6rio4DGTAYfpPvaoaH X-Proofpoint-ORIG-GUID: jN2H8cDFOqBvtQ6rio4DGTAYfpPvaoaH X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094024_393008_F29591ED X-CRM114-Status: GOOD ( 16.02 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently, link ID is assigned when BSS is going to set up either via driver init. Later if interface is disabled and enabled again, it will again call setup BSS which will give a new link ID to it. H [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently, link ID is assigned when BSS is going to set up either via driver init. Later if interface is disabled and enabled again, it will again call setup BSS which will give a new link ID to it. However, Link ID should be same for a BSS affliated to a MLD until the lifetime of the BSS. Hence, add change to assign the link ID during BSS creation itself. And it will remain until BSS entry is completely freed. Hence, link ID will not change as part of disable/enable. Also, since link ID would be decided now, it will help in creating link level control sockets in a subsequent patch. Signed-off-by: Aditya Kumar Singh --- hostapd/main.c | 2 -- src/ap/hostapd.c | 10 +++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hostapd/main.c b/hostapd/main.c index 6df7868c778b..97e9704c7046 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -211,7 +211,6 @@ static int hostapd_driver_init(struct hostapd_iface *iface) os_memcpy(hapd->own_addr, b, ETH_ALEN); } - hapd->mld_link_id = hapd->mld->next_link_id++; hostapd_mld_add_link(hapd); goto setup_mld; @@ -296,7 +295,6 @@ static int hostapd_driver_init(struct hostapd_iface *iface) else os_memcpy(hapd->own_addr, b, ETH_ALEN); - hapd->mld_link_id = hapd->mld->next_link_id++; hostapd_mld_add_link(hapd); } diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 13b2873c6cbf..38c4e253047d 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -73,7 +73,6 @@ static void hostapd_switch_color_timeout_handler(void *eloop_data, void *user_ctx); #endif /* CONFIG_IEEE80211AX */ - int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx) @@ -2914,6 +2913,13 @@ struct hostapd_iface * hostapd_alloc_iface(void) } #ifdef CONFIG_IEEE80211BE +static void hostapd_bss_alloc_link_id(struct hostapd_data *hapd) +{ + hapd->mld_link_id = hapd->mld->next_link_id++; + wpa_printf(MSG_DEBUG, "MLD: %s: Link ID %d assigned.", + hapd->mld->name, hapd->mld_link_id); +} + static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd, struct hapd_interfaces *interfaces) { @@ -2937,6 +2943,7 @@ static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd, continue; hapd->mld = mld; + hostapd_bss_alloc_link_id(hapd); break; } @@ -2956,6 +2963,7 @@ static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd, wpa_printf(MSG_DEBUG, "MLD %s created", mld->name); hapd->mld = mld; + hostapd_bss_alloc_link_id(hapd); all_mld = os_realloc_array(interfaces->mld, interfaces->mld_count + 1, sizeof(struct hostapd_mld *)); From patchwork Wed Mar 6 17:39:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908954 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=0ot5mVj8; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=R6riCOOS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqfqK1Skpz23qN for ; Thu, 7 Mar 2024 04:41:01 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bfABq7KE1T4PIl1RkKkF8mHDvFqKFlcsqT5DE3be+N0=; b=0ot5mVj8ZTB2XM n5toe6jc0Fud4WPuD9t1fM4r0l79GX2sKTQuNGCWFb+3PQ1mPlsR3OJUjyoZpFJzXg4elxDNd6vLi qAZJKndSwR+vj2/ejnwmSSUhyI2Z5p9jm4E/5Q66M/ud43jpJ02Y2h+KvblRCBm/XttvU/HwLOl8l iZcS/bd6707tPeaRRk2T5QD9CC/hS5GSSNtjORMxL5vokOTLewhRnGhFaE1W8HRfDLBKaKFUYqOAC 6Y2ttNs6wwAJpafEWrzs1dP6JOy+9ggl0PBzrB4zJ1Qa0HFFxcDjPB+rOgqCMdA7qybeubkomzk0l RnEDxKwLO/LIkRLaprsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFp-00000001DmE-19W6; Wed, 06 Mar 2024 17:40:33 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFh-00000001DiH-3AS9 for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:27 +0000 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426FHfDt006805 for ; Wed, 6 Mar 2024 17:40:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=t4UFv9PUf00+PevabxLMF4pmHUUvB96L84tD88FAfRk=; b=R6 riCOOSuAx9OWC48mub0TUkkrmTIpaEt8pJvozw6MNNrCk9wQYrZ7xyK+1e88Rbik AJcgwMFg2i67Z6Z/isqrDHRyvR7hKM/rBkhukoco84rhB6NEMfBK2bB9MSOx+cXr dpUW/hZp/z5URZDsH1r4VVJJTaXpEYY3cSlFuVOZ1s9fUCyfpckv8fm6vFT08zwt 8eKMf6gZlJsEkbKiT5F4ddEek8aZcZwvE0sL1K/xvS2io5sz7l5MDLDRLktvPZKx 3cDDVXYGxcTjJgDGr2EMf1kyrClrRR3PlgM2fPlIQ78OTW5c2Nq3xdIEGCpPxH94 AzVY1SC8MZ2tFYEDk8Fg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpjy3sfqv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:24 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeNut017244 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:23 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:22 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 06/16] hostapd: MLO: clean up MLD when not required any further Date: Wed, 6 Mar 2024 23:09:37 +0530 Message-ID: <20240306173947.2611965-7-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 27AivawC0tgrsTzPA-R4utQn68XemrPj X-Proofpoint-ORIG-GUID: 27AivawC0tgrsTzPA-R4utQn68XemrPj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=951 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094025_959432_FB3777EA X-CRM114-Status: GOOD ( 29.43 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently, whenever a new BSS is created, if it is an EHT then it is tied to a corresponding MLD structure. If structure does not exist already, a new one is created and tied to it. Accordingly link I [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently, whenever a new BSS is created, if it is an EHT then it is tied to a corresponding MLD structure. If structure does not exist already, a new one is created and tied to it. Accordingly link ID is assigned as well. However, when BSS is deleted, the MLD structure is not freed and when the next time it is again created, it increments the link ID further and gets a wrong link ID. For example - 2 GHz SLO AP case. First ADD, link ID 0 would be assigned and mld wlan0 would be created. When REMOVE is issued, BSS would be deleted but mld wlan0 will not. When again ADD is issued, BSS will tie back to mld wlan0 but this time link ID will be incremented again and 1 would be assigned. Hence at subsequent REMOVE/ADD, link ID keeps on incrementing. Since link ID remains till lifetime of the BSS and MLD, the next link ID counter can not be just reset back to 0 when a BSS is deleted. Otherwise, in interleaved link enable/disable case, link ID would be changed. Hence to overcome this situation, add changes so that whenever a BSS is deleted, if the MLD is not referenced by any other existing BSS, delete the MLD structure itself. In order to know how many BSSes are referring a given MLD, introduce a new member refcount in MLD. If he value is 0 then it is safe to delete the MLD. Signed-off-by: Aditya Kumar Singh --- src/ap/hostapd.c | 132 +++++++++++++++++++++++++++++++++++++++++++++++ src/ap/hostapd.h | 8 +++ 2 files changed, 140 insertions(+) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 38c4e253047d..a8ae0130fef6 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -73,6 +73,11 @@ static void hostapd_switch_color_timeout_handler(void *eloop_data, void *user_ctx); #endif /* CONFIG_IEEE80211AX */ +#ifdef CONFIG_IEEE80211BE +static void hostapd_mld_ref_inc(struct hostapd_mld *mld); +static void hostapd_mld_ref_dec(struct hostapd_mld *mld); +#endif /* CONFIG_IEEE80211BE */ + int hostapd_for_each_interface(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx) @@ -2891,6 +2896,11 @@ void hostapd_interface_free(struct hostapd_iface *iface) for (j = 0; j < iface->num_bss; j++) { if (!iface->bss) break; +#ifdef CONFIG_IEEE80211BE + if (iface->bss[j]) + hostapd_mld_ref_dec(iface->bss[j]->mld); +#endif /* CONFIG_IEEE80211BE */ + wpa_printf(MSG_DEBUG, "%s: free hapd %p", __func__, iface->bss[j]); os_free(iface->bss[j]); @@ -2913,6 +2923,34 @@ struct hostapd_iface * hostapd_alloc_iface(void) } #ifdef CONFIG_IEEE80211BE +static void hostapd_mld_ref_inc(struct hostapd_mld *mld) +{ + if (!mld) + return; + + if (mld->refcount == HOSTAPD_MLD_MAX_REF_COUNT) { + wpa_printf(MSG_ERROR, "MLD %s: Ref count overflow", + mld->name); + return; + } + + mld->refcount++; +} + +static void hostapd_mld_ref_dec(struct hostapd_mld *mld) +{ + if (!mld) + return; + + if (!mld->refcount) { + wpa_printf(MSG_ERROR, "MLD %s: Ref count underflow", + mld->name); + return; + } + + mld->refcount--; +} + static void hostapd_bss_alloc_link_id(struct hostapd_data *hapd) { hapd->mld_link_id = hapd->mld->next_link_id++; @@ -2943,6 +2981,7 @@ static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd, continue; hapd->mld = mld; + hostapd_mld_ref_inc(mld); hostapd_bss_alloc_link_id(hapd); break; } @@ -2957,12 +2996,14 @@ static void hostapd_bss_setup_multi_link(struct hostapd_data *hapd, os_strlcpy(mld->name, conf->iface, sizeof(conf->iface)); mld->next_link_id = 0; mld->num_links = 0; + mld->refcount = 0; mld->fbss = NULL; dl_list_init(&mld->links); wpa_printf(MSG_DEBUG, "MLD %s created", mld->name); hapd->mld = mld; + hostapd_mld_ref_inc(mld); hostapd_bss_alloc_link_id(hapd); all_mld = os_realloc_array(interfaces->mld, interfaces->mld_count + 1, @@ -2983,6 +3024,81 @@ fail: os_free(mld); hapd->mld = NULL; } + +static void hostapd_cleanup_unused_mlds(struct hapd_interfaces *interfaces) +{ + struct hostapd_mld *mld, **all_mld; + size_t i, j, num_mlds; + bool forced_remove, remove; + + if (!interfaces || !interfaces->mld) + return; + + num_mlds = interfaces->mld_count; + + for (i = 0; i < interfaces->mld_count; i++) { + mld = interfaces->mld[i]; + if (!mld) + continue; + + remove = false; + forced_remove = false; + + if (!mld->refcount) + remove = true; + + /* If mld is still being referenced but no. of interfaces + * are zero then it is safe to force delete it. Normally, + * this should not happen but even if it does, let us free + * the memory + */ + if (!remove && !interfaces->count) + forced_remove = true; + + if (!remove && !forced_remove) + continue; + + wpa_printf(MSG_DEBUG, "MLD %s: freed (forced: %d)", mld->name, + forced_remove); + os_free(mld); + interfaces->mld[i] = NULL; + num_mlds--; + } + + if (!num_mlds) { + interfaces->mld_count = 0; + os_free(interfaces->mld); + interfaces->mld = NULL; + return; + } + + all_mld = os_zalloc(num_mlds * sizeof(struct hostapd_mld *)); + if (!all_mld) { + wpa_printf(MSG_DEBUG, + "MLD: failed to re-allocate the MLDs. Expect issues"); + return; + } + + for (i = 0, j = 0; i < interfaces->mld_count; i++) { + mld = interfaces->mld[i]; + if (!mld) + continue; + + all_mld[j++] = mld; + } + + /* should not happen */ + if (j != num_mlds) { + wpa_printf(MSG_DEBUG, + "MLD: some error occurred while reallocating MLDs. Expect issues."); + os_free(all_mld); + return; + } + + os_free(interfaces->mld); + interfaces->mld = all_mld; + interfaces->mld_count = num_mlds; +} #endif /* CONFIG_IEEE80211BE */ /** @@ -3587,6 +3703,9 @@ int hostapd_add_iface(struct hapd_interfaces *interfaces, char *buf) __func__, hapd, hapd->conf->iface); hostapd_config_free_bss(hapd->conf); hapd->conf = NULL; +#ifdef CONFIG_IEEE80211BE + hostapd_mld_ref_dec(hapd->mld); +#endif /* CONFIG_IEEE80211BE */ os_free(hapd); return -1; } @@ -3678,6 +3797,9 @@ fail: hapd->conf->iface); hostapd_bss_link_deinit(hapd); hostapd_cleanup(hapd); +#ifdef CONFIG_IEEE80211BE + hostapd_mld_ref_dec(hapd->mld); +#endif /* CONFIG_IEEE80211BE */ os_free(hapd); hapd_iface->bss[i] = NULL; } @@ -3687,6 +3809,9 @@ fail: if (new_iface) { interfaces->count--; interfaces->iface[interfaces->count] = NULL; +#ifdef CONFIG_IEEE80211BE + hostapd_cleanup_unused_mlds(interfaces); +#endif /* CONFIG_IEEE80211BE */ } hostapd_cleanup_iface(hapd_iface); } @@ -3709,6 +3834,9 @@ static int hostapd_remove_bss(struct hostapd_iface *iface, unsigned int idx) __func__, hapd, hapd->conf->iface); hostapd_config_free_bss(hapd->conf); hapd->conf = NULL; +#ifdef CONFIG_IEEE80211BE + hostapd_mld_ref_dec(hapd->mld); +#endif /* CONFIG_IEEE80211BE */ os_free(hapd); iface->num_bss--; @@ -3751,6 +3879,10 @@ int hostapd_remove_iface(struct hapd_interfaces *interfaces, char *buf) k++; } interfaces->count--; +#ifdef CONFIG_IEEE80211BE + hostapd_cleanup_unused_mlds(interfaces); +#endif /* CONFIG_IEEE80211BE */ + return 0; } diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index ec090cbbaa85..27b158c51de9 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -506,10 +506,18 @@ struct hostapd_mld { u8 mld_addr[ETH_ALEN]; u8 next_link_id; u8 num_links; + /* No. of hostapd_data (hapd) referencing to this. num_links can't + * be used since num_links can go to 0 even when bss is disabled + * and when it is enabled back, the MLD should exist hence it can + * not be freed when it is 0. + */ + u8 refcount; struct hostapd_data *fbss; struct dl_list links; /* List HEAD of all affiliated links */ }; + +#define HOSTAPD_MLD_MAX_REF_COUNT 0xFF #endif /* CONFIG_IEEE80211BE */ /** From patchwork Wed Mar 6 17:39:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908956 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=D7ALwuFc; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=ZmrHdXkK; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqfqK5dZRz23qk for ; Thu, 7 Mar 2024 04:41:01 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jaLs6FwkzZ4DMzJ8XNvZKkKUi7FJXSqhPeKht6JqZqs=; b=D7ALwuFcRq3Yf4 aTyH+fo8oECJ4vi50OuLozmmU7R6urKlnNsIwOH0qCsrh25t17gKKVOj9FftBfNbH5Mx+afD3BoWw 9cVe/kzCQycIpcGf9aYvsCpLtQAlvbaZiMMegS9ZJ746TdMohwLUgrVkzAqaczRnSpAMlyivlU4Hw 2004Eqj4o/hRV/Xosn4aJrIaE1gw9kGLnSXceh1rKLoYPjNf4Z5Sl9LFFiqITHsZdy6TYUY9/+njS qJwxG+Anewa9w5DysPOE+xAtflsmCsycx1QsSgd5fstHO9DiQW681dsG/3GJFSOm8qPOwx1NLBrfW qrR/E2O8To/b3+MeicJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFr-00000001Dnn-3HgL; Wed, 06 Mar 2024 17:40:35 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFj-00000001Dj4-2ZeB for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:29 +0000 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426E599u018929 for ; Wed, 6 Mar 2024 17:40:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=vzdaKa9fzih45kC59fEHyyFPTYIQIZ8wBtrfmCRiwlA=; b=Zm rHdXkKKVNfwb+8f1WUnurcd3Xoo3Sc+pX8Ptawn6/EG7F1nusAmOnCGi5Gng+AdF tTpwhzvwZ5vSkZyXZCLNSH7jTsZ9p6useuFsjFEUgG9EKHQBCXpEWLn2gdh7Qxv+ +sZpibl0Yeyk5joSWWL8iyIV+mSKSooYVm/WnT8TSpJfaDtx1ArGhezl3FEASkQe TyKdMRwJwLjxGd1vw2zXke7oR1Fc2jqpz7IZPtPBLyzc+xJ+mZ7gbmrb3y6e9Cz+ 6Iq4Y0zqCmrWLnBKUZt5GzjLscdtw4npLN9JqWmeyTtk5LCOIPr8yuVFI3jTYgfi HXQhvPKnE9avxNP+Jm3Q== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpsxhgj0g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:26 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HePiw017441 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:25 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:23 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 07/16] hostapd: MLO: cache hostapd_data context in per link bss struct Date: Wed, 6 Mar 2024 23:09:38 +0530 Message-ID: <20240306173947.2611965-8-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: hrmPvKrrbW8Zdr5dhievBzPDeVQE-2jn X-Proofpoint-ORIG-GUID: hrmPvKrrbW8Zdr5dhievBzPDeVQE-2jn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 spamscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 clxscore=1015 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094027_795413_30C8D7AC X-CRM114-Status: GOOD ( 15.48 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add changes to cache the corresponding hostapd_data struct context into it. This will be useful for wpa events callback processing. Signed-off-by: Aditya Kumar Singh --- src/ap/ap_drv_ops.h | 2 +- src/drivers/driver.h | 3 ++- src/drivers/driver_nl80211.c | 3 ++- src/drivers/driver_nl80211.h | 1 + 4 files c [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Add changes to cache the corresponding hostapd_data struct context into it. This will be useful for wpa events callback processing. Signed-off-by: Aditya Kumar Singh --- src/ap/ap_drv_ops.h | 2 +- src/drivers/driver.h | 3 ++- src/drivers/driver_nl80211.c | 3 ++- src/drivers/driver_nl80211.h | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h index f38b1850aca3..b3a96447947a 100644 --- a/src/ap/ap_drv_ops.h +++ b/src/ap/ap_drv_ops.h @@ -455,7 +455,7 @@ static inline int hostapd_drv_link_add(struct hostapd_data *hapd, if (!hapd->driver || !hapd->drv_priv || !hapd->driver->link_add) return -1; - return hapd->driver->link_add(hapd->drv_priv, link_id, addr); + return hapd->driver->link_add(hapd->drv_priv, link_id, addr, hapd); } #endif /* CONFIG_IEEE80211BE */ diff --git a/src/drivers/driver.h b/src/drivers/driver.h index eedc3f647dd9..8ffe487ae1c7 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -5137,9 +5137,10 @@ struct wpa_driver_ops { * @priv: Private driver interface data * @link_id: The link ID * @addr: The MAC address to use for the link + * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces * Returns: 0 on success, negative value on failure */ - int (*link_add)(void *priv, u8 link_id, const u8 *addr); + int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx); #ifdef CONFIG_TESTING_OPTIONS int (*register_frame)(void *priv, u16 type, diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index b3e9e6f2fe5e..dc19ef1158b3 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -13760,7 +13760,7 @@ static int nl80211_dpp_listen(void *priv, bool enable) #endif /* CONFIG_DPP */ -static int nl80211_link_add(void *priv, u8 link_id, const u8 *addr) +static int nl80211_link_add(void *priv, u8 link_id, const u8 *addr, void *bss_ctx) { struct i802_bss *bss = priv; struct wpa_driver_nl80211_data *drv = bss->drv; @@ -13819,6 +13819,7 @@ static int nl80211_link_add(void *priv, u8 link_id, const u8 *addr) bss->flink = &bss->links[link_id]; bss->valid_links |= BIT(link_id); + bss->links[link_id].ctx = bss_ctx; wpa_printf(MSG_DEBUG, "nl80211: MLD: valid_links=0x%04x", bss->valid_links); diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h index 43a6625bbf7a..03d3c333b3d1 100644 --- a/src/drivers/driver_nl80211.h +++ b/src/drivers/driver_nl80211.h @@ -58,6 +58,7 @@ struct i802_link { int freq; int bandwidth; u8 addr[ETH_ALEN]; + void *ctx; }; struct i802_bss { From patchwork Wed Mar 6 17:39:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=O+9wowvf; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=nc48F8Lj; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqfqK2Ppdz23qV for ; Thu, 7 Mar 2024 04:41:01 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sKR/GSY5w0mmXDtDYjOu1EebkGOMZzFPyfTeSgRKnwU=; b=O+9wowvfdtJN6h vdf7GVXzsy1V1BqRUU05xpNFdDEogCyh8TrNCGkq1vzubSXMtrNDivZ3K/vP6CAuVAytGUvQFtg4A lVLGN5MwHr4CbxKE2eAdGpNSoyd7QdzCB/OJc7tS/g277R24AOKzL6w4x4UAQZeAamZnoJNrkWvSI YQjWP7NeBOY/tE8uW+23macHOb9/WeRh71gkuGlnNui3TI4xpD2NLSIVfte0rVd/2+b9luQavJCV4 DsFsyrOim8YLs0PT0wHXYx7bkDEYnhIG+VkpCLuw+YcFx9Ok+cy7br5bPGxANgR3/bczoPkJTwOf1 VqNiDOdVuSIelGOfQgdg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFv-00000001Dr6-3xuh; Wed, 06 Mar 2024 17:40:39 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFk-00000001Djc-1CtV for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:29 +0000 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426EnCdb002400 for ; Wed, 6 Mar 2024 17:40:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=A5U79nfpA2ml8PROReeGE4AY11ZbO8HmwVCFi6hlU+4=; b=nc 48F8Ljd4ZoIAUw4BNQXbX4WVANodkXSwX8t1m+MHcIc3ddg+lXhHotYzr8TVaFNW Oh4cB5b8HC/C2FBsDa3DruRIudZjalk+g5YCbCr1UM+kR1kCr1+z5UDRo8NXOYsD 8XHpO31GNsB3fNiJV+kihxqye40dxiudKhqe5Q8imBW+dhEtzvTp0GXYlsXeO5Ja QxelFBHypXHMMWuhn5bv9AzZ3IQdZrtlCf23CJDN1O/qO7JzOj3xhztUEEGwwwaC c4lwYVI5Xu4YxftnrCyjyqH3jWPhj7UwsHZL5fwDf3xouOIRroAP+zomYyC4pXnk aU1rMJg2vlFb9AvSJ+dA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpgwmspsc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:27 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeRQv012716 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:27 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:25 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 08/16] hostapd: MLO: remove redundant put_freq call in set_ap Date: Wed, 6 Mar 2024 23:09:39 +0530 Message-ID: <20240306173947.2611965-9-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 8IVfO9ofuDv7XHDJoVgGVnlWllC6YF7o X-Proofpoint-ORIG-GUID: 8IVfO9ofuDv7XHDJoVgGVnlWllC6YF7o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 clxscore=1015 spamscore=0 bulkscore=0 impostorscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060142 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094028_421636_4CDCD1FF X-CRM114-Status: GOOD ( 14.19 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently wpa_driver_nl80211_set_ap() calls nl80211_put_freq_params() two times if AP is a MLD AP. It calls one while putting MLO link ID and other in the normal flow if frequency info is present. Cal [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently wpa_driver_nl80211_set_ap() calls nl80211_put_freq_params() two times if AP is a MLD AP. It calls one while putting MLO link ID and other in the normal flow if frequency info is present. Calling two times is not required. Hence, add code changes to call it via the normal flow only and if the AP is MLD AP, add MLO link ID as well. Signed-off-by: Aditya Kumar Singh --- src/drivers/driver_nl80211.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index dc19ef1158b3..856c004b27c2 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -5099,20 +5099,6 @@ static int wpa_driver_nl80211_set_ap(void *priv, nla_put(msg, NL80211_ATTR_SSID, params->ssid_len, params->ssid)) goto fail; - if (params->mld_ap) { - wpa_printf(MSG_DEBUG, "nl80211: link_id=%u", - params->mld_link_id); - - if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, - params->mld_link_id) || - (params->freq && - nl80211_put_freq_params(msg, params->freq) < 0)) - goto fail; - - nl80211_link_set_freq(bss, params->mld_link_id, - params->freq->freq); - } - if (params->proberesp && params->proberesp_len) { wpa_hexdump(MSG_DEBUG, "nl80211: proberesp (offload)", params->proberesp, params->proberesp_len); @@ -5355,6 +5341,19 @@ static int wpa_driver_nl80211_set_ap(void *priv, if (params->freq && nl80211_put_freq_params(msg, params->freq) < 0) goto fail; + if (params->mld_ap) { + wpa_printf(MSG_DEBUG, "nl80211: link_id=%u", + params->mld_link_id); + + if (nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, + params->mld_link_id)) + goto fail; + + if (params->freq) + nl80211_link_set_freq(bss, params->mld_link_id, + params->freq->freq); + } + if (params->freq && params->freq->he_enabled && nl80211_attr_supported(drv, NL80211_ATTR_HE_BSS_COLOR)) { struct nlattr *bss_color; From patchwork Wed Mar 6 17:39:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908958 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=DEvyEFfN; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=njPIN0aH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqfqY20ZTz1yX4 for ; Thu, 7 Mar 2024 04:41:13 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EPGQmGUhAztfv9L3MjYaR+4IYOBRLRMWUdqc0v546to=; b=DEvyEFfNcHyN7b w3NQQmrZB1VQq0XQKkQU5MMP+rUoovs09FHoOKu/aX+z+0IWHrKDFslbnFrqO0DVqJbkioGSAgntI lb2NE9Kd3GoY8zLnLQkASwNGDMDCO38MQVZETHyWnF7WWPLuyZWP5/oJRsGsnU8joxYmYFKUt5oSB GNSZXeUEb35ks9XyJV3OUMiM9n/SAimqubbRBzxsP0n23WdwdmTSmIVoacduTQxClKf+3aWdal443 0r6RnR43g9PN727d0+ABkoSJo3rhJJAjsQNa9/kPldkSB6Nburf+t8kAq3b+ziC5vMhuMfMzGOVGJ rmboPRP7D/0B/FNmQIHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvG0-00000001DvQ-2QAE; Wed, 06 Mar 2024 17:40:44 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFm-00000001Dkf-4873 for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:33 +0000 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426BbtRh021220 for ; Wed, 6 Mar 2024 17:40:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=pf8JB/nO6npTBPplmZUJIVd7wJ5Z+Ev+AS6p8u6nU/A=; b=nj PIN0aHl2p3f0zNu4qH57LiGZZOR6Yd2ghU5/+54qBuryDJhRZ4049E/hg3QyEnk+ LfLTANpvIu+pD/iaUbkPMTyAr83VDHh/NmHruzssgDWAV5QVDsiVkhpK0fyun+oW BHQWk8mAk829se+XVLpAQ+cU3ToqAkWF9KCw2L+NBeknaU1CcP/oYXQoq6KAo5x1 hliP3OBjRhRRrngAzr3u0pkDh0ko7FTaxN/tRFhQnEbxhjS8HFfXm8jFAExXWxie a5avxY/jaGcvTYjjb7njD12IBRUVofwFBef9h4eH1e3CRbfqpxcj2OKAdULfX51/ bCwvP8WNB8EGbde1oh3A== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpkkase5b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:29 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeSGV032226 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:28 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:27 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 09/16] hostapd: MLO: re-factor nl80211_remove_links() function Date: Wed, 6 Mar 2024 23:09:40 +0530 Message-ID: <20240306173947.2611965-10-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: eYbqnMSiGLc_7TpE4fmGrRbkstK0_W3Z X-Proofpoint-GUID: eYbqnMSiGLc_7TpE4fmGrRbkstK0_W3Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094031_239858_5C2F042F X-CRM114-Status: GOOD ( 19.67 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently, nl80211_remove_links() iterates over all active links in the given BSS and remove all of them. However, at times it is required to remove only one link and not all links. Hence, add a helper function nl80211_remove_link() which will remove just the given link_id from the passed BSS. nl80211_remove_links() will use this and will call this for each of the active link to [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently, nl80211_remove_links() iterates over all active links in the given BSS and remove all of them. However, at times it is required to remove only one link and not all links. Hence, add a helper function nl80211_remove_link() which will remove just the given link_id from the passed BSS. nl80211_remove_links() will use this and will call this for each of the active link to be removed. While at it, also make the NL remove link command to be formed per bss instead of per drv->first_bss. Signed-off-by: Aditya Kumar Singh --- src/drivers/driver_nl80211.c | 100 ++++++++++++++++++++--------------- 1 file changed, 58 insertions(+), 42 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 856c004b27c2..7fa8a155f74d 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -9421,64 +9421,80 @@ fail: return -1; } - -static void nl80211_remove_links(struct i802_bss *bss) +static int nl80211_remove_link(struct i802_bss *bss, int link_id) { struct wpa_driver_nl80211_data *drv = bss->drv; + struct i802_link *link; struct nl_msg *msg; + size_t i; int ret; - u8 link_id, i; - for_each_link(bss->valid_links, link_id) { - struct i802_link *link = &bss->links[link_id]; - - wpa_printf(MSG_DEBUG, "nl80211: MLD: remove link_id=%u", - link_id); + wpa_printf(MSG_DEBUG, "nl80211: Remove link (ifindex=%d)", bss->ifindex); + wpa_printf(MSG_DEBUG, "nl80211: MLD: remove link_id=%u", link_id); - wpa_driver_nl80211_del_beacon(bss, link_id); + if (!(bss->valid_links & BIT(link_id))) { + wpa_printf(MSG_DEBUG, "nl80211: MLD: remove link: Link not found"); + return -1; + } - /* First remove the link locally */ - bss->valid_links &= ~BIT(link_id); - os_memset(link->addr, 0, ETH_ALEN); + link = &bss->links[link_id]; - /* Choose new deflink if we are removing that link */ - if (bss->flink == link) { - for_each_link_default(bss->valid_links, i, 0) { - bss->flink = &bss->links[i]; - break; - } - } + wpa_driver_nl80211_del_beacon(bss, link_id); - /* If this was the last link, reset default link */ - if (!bss->valid_links) { - /* TODO: Does keeping freq/bandwidth make sense? */ - if (bss->flink != link) - os_memcpy(bss->flink, link, sizeof(*link)); + /* First remove the link locally */ + bss->valid_links &= ~BIT(link_id); + os_memset(link->addr, 0, ETH_ALEN); - os_memcpy(bss->flink->addr, bss->addr, ETH_ALEN); + /* Choose new deflink if we are removing that link */ + if (bss->flink == link) { + for_each_link_default(bss->valid_links, i, 0) { + bss->flink = &bss->links[i]; + break; } + } - /* Remove the link from the kernel */ - msg = nl80211_drv_msg(drv, 0, NL80211_CMD_REMOVE_LINK); - if (!msg || - nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) { - nlmsg_free(msg); - wpa_printf(MSG_ERROR, - "nl80211: remove link (%d) failed", - link_id); - continue; - } + /* If this was the last link, reset default link */ + if (!bss->valid_links) { + /* TODO: Does keeping freq/bandwidth make sense? */ + if (bss->flink != link) + os_memcpy(bss->flink, link, sizeof(*link)); - ret = send_and_recv_cmd(drv, msg); - if (ret) { - wpa_printf(MSG_ERROR, - "nl80211: remove link (%d) failed. ret=%d (%s)", - link_id, ret, strerror(-ret)); - continue; - } + os_memcpy(bss->flink->addr, bss->addr, ETH_ALEN); } + + /* Remove the link from the kernel */ + msg = nl80211_bss_msg(bss, 0, NL80211_CMD_REMOVE_LINK); + if (!msg || + nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) { + nlmsg_free(msg); + wpa_printf(MSG_ERROR, + "nl80211: remove link (%d) failed", link_id); + return -1; + } + + ret = send_and_recv_cmd(drv, msg); + if (ret) + wpa_printf(MSG_ERROR, + "nl80211: remove link (%d) failed. ret=%d (%s)", + link_id, ret, strerror(-ret)); + + return ret; } +static void nl80211_remove_links(struct i802_bss *bss) +{ + u8 link_id; + int ret; + + for_each_link(bss->valid_links, link_id) { + ret = nl80211_remove_link(bss, link_id); + if (ret) + break; + } + + if (bss->flink) + os_memcpy(bss->flink->addr, bss->addr, ETH_ALEN); +} static int wpa_driver_nl80211_deinit_ap(void *priv) { From patchwork Wed Mar 6 17:39:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908960 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Ijnm5Jaj; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=nWW8nKqu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tqfqc4fNDz1yX4 for ; Thu, 7 Mar 2024 04:41:16 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ue3n0rp5Dle/zwaHiA/556UbJTkOrbjOz+8KtrHrkcE=; b=Ijnm5JajecmA+n w6zeGuUp7UbQUsVRz0j3K9TpoglPV9nxSoYK656GXjh1kd8saJNaJ4kNLy1zWH+D2kjufbjGOqoON 0lsRCws6q7nEynAXTs2yozEkFsBxFc5aQjK2lzAbMcTrorrB/9JTV4J1/YczDbPoiBxaFokUpJPJ2 li50Vavk2hrYkYbW1EFpg1i08zpthITgXCR29UYwUn4cG1WQo1VPBynpkkMJuidGLLoXZDQFyitBT 7/5AiocbkFcitSQKzrngekZfzm14vqjYhq8zzGZC7/hed9dJLwT06T5T0n6BNpSfm0dpJ3KHY3ft2 WJ1jrZ1S5DAAc8E7tfTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvG5-00000001DyT-2vOk; Wed, 06 Mar 2024 17:40:49 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFn-00000001Dla-2naN for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:33 +0000 Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426F2TDg015524 for ; Wed, 6 Mar 2024 17:40:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=KJLfo1pXD3b34Nsjtqjic89MIeKOXo2Cj0kRb8qTc2U=; b=nW W8nKquIiYI9OE/QAdR/GNRCjbu2sQDFXYzgqAVeAl9avGgLMQLb/O/y1HSMpQylZ HrPNHaQfgVpZnOwFmomKW1lH8d6y0rmXMIH7E4v5WeDQWFV0NBWJlRAPn80joyNW aREDiTHWgSKjEs07IjQbOlG4y3gHcvJOo6XHPEfSvYgjQp5xCIkB+mDYLHhfJlWh WqKCuRVvJEDQK/sN05EDoZVqBTKgxZeLUJTfPIXd34l6FV9ThQyRCkxhtFfWyR3Y xsLpscUImf/s5cDwhdSZOaYDF2+8mZxHfvWH9rojiiD2BhShsSAOoLdTWHdilRIA MGNmaUPyW9Hh08jQq7iw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpts7rent-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:31 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeU9M021807 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:30 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:28 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 10/16] hostpad: MLO: nl80211: remove links while removing the interface Date: Wed, 6 Mar 2024 23:09:41 +0530 Message-ID: <20240306173947.2611965-11-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 6kyGRRPG4HkwcyTxpCBmsn4CFD2r6VhJ X-Proofpoint-GUID: 6kyGRRPG4HkwcyTxpCBmsn4CFD2r6VhJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 lowpriorityscore=0 mlxscore=0 spamscore=0 phishscore=0 impostorscore=0 malwarescore=0 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094031_882170_369335CC X-CRM114-Status: GOOD ( 13.76 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently, when interface is removed, the links added are not removed. While removing the interface, kernel has removed the stale links but hostapd has not. This is wrong since hostapd should remove a [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently, when interface is removed, the links added are not removed. While removing the interface, kernel has removed the stale links but hostapd has not. This is wrong since hostapd should remove and do the clean ups properly while removing the interface. Hence add changes to remove links when interface is removed. Signed-off-by: Aditya Kumar Singh --- src/drivers/driver_nl80211.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 7fa8a155f74d..ef9a513b663b 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8965,6 +8965,7 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss, tbss->next = bss->next; /* Unsubscribe management frames */ nl80211_teardown_ap(bss); + nl80211_remove_links(bss); nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); @@ -8979,6 +8980,7 @@ static int wpa_driver_nl80211_if_remove(struct i802_bss *bss, } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); + nl80211_remove_links(bss); if (!bss->added_if && !drv->first_bss->next) wpa_driver_nl80211_del_beacon_all(bss); nl80211_destroy_bss(bss); From patchwork Wed Mar 6 17:39:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908963 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=gc01PRWt; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=TKwyHSFh; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tqfqn5kRJz1yX4 for ; Thu, 7 Mar 2024 04:41:25 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hZzbfqIb1kKr8hQAHKoKurqQICsiDAqhq1vuht7jD7k=; b=gc01PRWt0sJobw bqjNc0PhLdrK1CzcuY8eiFPqLc5iCoUI7RMhUHwZOSkZI/pqwkmlynYyS6GZCaIFdse2+VIE98L6b pIVu8fvJo3ytUIHUUuh5knj117hbQ8QwRzWzzI720opoJ3IvmfckO98sm7HWm8V1sBgN4w+hTBBKG nL7kD2T+taEnl5o3JC4QdizGBbbq68AdHlfA/MXxtBNe36SBXjcsPiDo3Mqs8y4CXwgKSS2ZC1hhI EKY2swrM2HdioW5cNZsYPIC96f/Sz2aZa+cVDILFBi1ccvU4JIIf/mHsAug3sDSJDUe74jQBr7ECu 7tpu3ByIoRpuwVW0CvvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvGB-00000001E3G-1kok; Wed, 06 Mar 2024 17:40:55 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFq-00000001Dmr-1M9X for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:37 +0000 Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426D0Pev030322 for ; Wed, 6 Mar 2024 17:40:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=HuWpTAgCYCZZIIVF/k3bHQXKKhd+8CJvIXKmFqqnmzY=; b=TK wyHSFhqd6NPwlSXG7m+conUwfqLAG40229E5ICYp2K6kgMoPpdp1az/HAp08qphw yZLF2AMFgoA8e3pmYBejYpeqk/3txIgIjM+lBHs0v7niKIgxRR+nQX6NHOWxidWp oWOianxt2YAdTBL3q8msVYyk8oVN+wj0MB2k2APL0sILjnHf3kStNyosmHEl8tXn Loy9Z4QaXVOs4r7brpX2yOyiyb8TfFmeqOe8VSlpVTi5WDRl+ZBt7ZYRR6Lf5IRQ NXpl+qP+3D38tWvb9GN1fD19cEMOv2SRqRCp/I8K/C1MksJsahPL6Qi7NCrYqIR2 Een2HRfGZetaK1OIeCsw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpktpsd6n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:33 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeWKT032609 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:32 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:30 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 11/16] hostapd: MLO: add support to remove the link before removing interface Date: Wed, 6 Mar 2024 23:09:42 +0530 Message-ID: <20240306173947.2611965-12-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: qEtlLVpOHuMCcDmYm6iSQ8eZCxgCRwVb X-Proofpoint-ORIG-GUID: qEtlLVpOHuMCcDmYm6iSQ8eZCxgCRwVb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 spamscore=0 clxscore=1015 mlxlogscore=999 mlxscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094034_679792_CFB70FB0 X-CRM114-Status: GOOD ( 22.83 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently whenever if_remove() is called, whole interface is deleted. In MLO, all partner BSS uses the same driver private hence removing the interface when only one the link goes down should be avoid [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently whenever if_remove() is called, whole interface is deleted. In MLO, all partner BSS uses the same driver private hence removing the interface when only one the link goes down should be avoided. Add helper function to remove link first whenever if_remove() is called. Later while handling it, if number of links active goes to 0, then the if_remove() would be called in order to clean up the interface. This helper would be used later when co-hosted MLD support is added as well later during ML reconfiguration support. Signed-off-by: Aditya Kumar Singh --- src/ap/ap_drv_ops.c | 18 +++++++++++++ src/ap/ap_drv_ops.h | 3 +++ src/drivers/driver.h | 14 ++++++++++ src/drivers/driver_nl80211.c | 50 ++++++++++++++++++++++++++++++++++++ src/drivers/driver_nl80211.h | 1 + 5 files changed, 86 insertions(+) diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index a6f53fd8cbb1..5dfcdac3a137 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -571,6 +571,18 @@ int hostapd_if_add(struct hostapd_data *hapd, enum wpa_driver_if_type type, bridge, use_existing, 1); } +#ifdef CONFIG_IEEE80211BE +int hostapd_if_link_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type, + const char *ifname, u8 link_id) +{ + if (hapd->driver == NULL || hapd->drv_priv == NULL || + hapd->driver->if_link_remove == NULL) + return -1; + + return hapd->driver->if_link_remove(hapd->drv_priv, type, ifname, + hapd->mld_link_id); +} +#endif /* CONFIG_IEEE80211BE */ int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type, const char *ifname) @@ -578,6 +590,12 @@ int hostapd_if_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type, if (hapd->driver == NULL || hapd->drv_priv == NULL || hapd->driver->if_remove == NULL) return -1; + +#ifdef CONFIG_IEEE80211BE + if (hapd->conf->mld_ap) + return hostapd_if_link_remove(hapd, type, ifname, hapd->mld_link_id); +#endif /* CONFIG_IEEE80211BE */ + return hapd->driver->if_remove(hapd->drv_priv, type, ifname); } diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h index b3a96447947a..9c74ef579b2f 100644 --- a/src/ap/ap_drv_ops.h +++ b/src/ap/ap_drv_ops.h @@ -458,6 +458,9 @@ static inline int hostapd_drv_link_add(struct hostapd_data *hapd, return hapd->driver->link_add(hapd->drv_priv, link_id, addr, hapd); } + +int hostapd_if_link_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type, + const char *ifname, u8 link_id); #endif /* CONFIG_IEEE80211BE */ #endif /* AP_DRV_OPS */ diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 8ffe487ae1c7..6616397fb5d9 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -5142,6 +5142,20 @@ struct wpa_driver_ops { */ int (*link_add)(void *priv, u8 link_id, const u8 *addr, void *bss_ctx); +#ifdef CONFIG_IEEE80211BE + /** + * if_link_remove - Remove a link alone from virtual interface + * @priv: Private driver interface data + * @type: Interface type + * @ifname: Interface name of the virtual interface from where link is + * to be removed + * @link_id: Valid link ID to remove + * Returns: 0 on success, -1 on failure + */ + int (*if_link_remove)(void *priv, enum wpa_driver_if_type type, + const char *ifname, s8 link_id); +#endif /* CONFIG_IEEE80211BE */ + #ifdef CONFIG_TESTING_OPTIONS int (*register_frame)(void *priv, u16 type, const u8 *match, size_t match_len, diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index ef9a513b663b..d5f7cc7d041c 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -196,6 +196,7 @@ static int nl80211_leave_ibss(struct wpa_driver_nl80211_data *drv, static int i802_set_iface_flags(struct i802_bss *bss, int up); static int nl80211_set_param(void *priv, const char *param); static void nl80211_remove_links(struct i802_bss *bss); +static int nl80211_remove_link(struct i802_bss *bss, int link_id); #ifdef CONFIG_MESH static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params); @@ -10709,6 +10710,52 @@ static int driver_nl80211_if_remove(void *priv, enum wpa_driver_if_type type, return wpa_driver_nl80211_if_remove(bss, type, ifname); } +#ifdef CONFIG_IEEE80211BE +static int wpa_driver_nl80211_if_link_remove(struct i802_bss *bss, + enum wpa_driver_if_type type, + const char *ifname, + s8 link_id) +{ + struct wpa_driver_nl80211_data *drv = bss->drv; + + wpa_printf(MSG_DEBUG, "nl80211: %s(type=%d ifname=%s links=0x%x) link_id=%d", + __func__, type, ifname, bss->valid_links, link_id); + wpa_printf(MSG_DEBUG, "nl80211: Teardown AP(%s) link %d", bss->ifname, + link_id); + + nl80211_remove_link(bss, link_id); + + bss->ctx = bss->flink->ctx; + + if (drv->first_bss == bss && !bss->valid_links) + drv->ctx = bss->ctx; + + if (!bss->valid_links) { + wpa_printf(MSG_DEBUG, + "nl80211: Only 1 link was there hence remove interface"); + return wpa_driver_nl80211_if_remove(bss, type, ifname); + } + + return 0; +} + +static int driver_nl80211_if_link_remove(void *priv, enum wpa_driver_if_type type, + const char *ifname, s8 link_id) +{ + struct i802_bss *bss = priv; + + if (link_id < 0 || link_id >= MAX_NUM_MLD_LINKS) + return -1; + + if (type != WPA_IF_AP_BSS) + return -1; + + if (!(bss->valid_links & BIT(link_id))) + return -1; + + return wpa_driver_nl80211_if_link_remove(bss, type, ifname, link_id); +} +#endif /* CONFIG_IEEE80211BE */ static int driver_nl80211_send_mlme(void *priv, const u8 *data, size_t data_len, int noack, @@ -14038,6 +14085,9 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { #endif /* CONFIG_DPP */ .get_sta_mlo_info = nl80211_get_sta_mlo_info, .link_add = nl80211_link_add, +#ifdef CONFIG_IEEE80211BE + .if_link_remove = driver_nl80211_if_link_remove, +#endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_TESTING_OPTIONS .register_frame = testing_nl80211_register_frame, .radio_disable = testing_nl80211_radio_disable, diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h index 03d3c333b3d1..3e5a53452f00 100644 --- a/src/drivers/driver_nl80211.h +++ b/src/drivers/driver_nl80211.h @@ -352,6 +352,7 @@ const char * nl80211_iftype_str(enum nl80211_iftype mode); void nl80211_restore_ap_mode(struct i802_bss *bss); struct i802_link * nl80211_get_link(struct i802_bss *bss, s8 link_id); +int nl80211_is_valid_link(struct i802_bss *bss, s8 link_id); static inline bool nl80211_link_valid(u16 links, s8 link_id) { From patchwork Wed Mar 6 17:39:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908959 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=yOGSelOo; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=JGtiez5A; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tqfqb2WnVz1yX4 for ; Thu, 7 Mar 2024 04:41:15 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FjpisVnQsXv39c8AGDvKqcHeYGjKDuEX/OTvEqbMb4g=; b=yOGSelOoAHwnUM ILAxA5PX/VKX+tDq3BqimDhT+p3kNFUh1VmJ+NpF69H01ndWI/p1xaLHyd2PGb5sI0bwTE6S5NzzC 5Ihbx0fjYpbWxwQXXKEmXolyyd902BnGiwJ1SVL09xAi6Lrd/e/51/NJ3yAfucwDbmpFMAEn/bBSv bB49A1iqbCyEjHZE2MSVdNEHSVHEYNdm+aooiwRT5tKRL44+I3Z1go2ixkQn+75x9aIQpqX7KWnra Dzmtgg6hEgfTncgi9Z+uBUD5yF8y3xKLQNHD1DC6wQuxeaTHL/frS3azqiRwTIfgboI9w7gQ73Wc5 hRGU2nA05zGD8Kgmg8XA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvG7-00000001E0l-477q; Wed, 06 Mar 2024 17:40:51 +0000 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFq-00000001Dnm-4044 for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:37 +0000 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4265F285004667 for ; Wed, 6 Mar 2024 17:40:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=ApVK9Y8waAbxa5F91a0QtQlbhnFUDEn5d7vmt72Vj6o=; b=JG tiez5AHDIO6mKp3KTJeVWyDYyGpaIratSnEuvRECoN055IT4/ftKnmrFfh0rD25M stlU1/hIzzV01KfU3QpxO6Wre5ZgvR9wf5fgQsORpULhpODZq9dQnSD2gi7UxWM6 jHy0bF30zJ2Zq/2y7y6Cs1xKTv/cYKI80LsCfmTjvW7AlftzGTK43fLVaHR4VRsM yvHZhGFTKAIjgd5lCwuJPx4rg13wb2dbbGIBdFbJLUEnd1Gq3IIkKjWMHOYkhVzl fbNClE9cRDN418h+1KDEDn13X9bO6Aa9p4QQnA5WAFzcnhTmQ/im09ERfoF+eL3R p6XbuPJf5qAuvZBgANqQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpgwmspsn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:34 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeXXV017800 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:33 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:32 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 12/16] hostapd: MLO: refresh other iface beacons when one iface gets disabled/enabled Date: Wed, 6 Mar 2024 23:09:43 +0530 Message-ID: <20240306173947.2611965-13-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Yugv8E0dqdCwSSUqb7OaGltLi84muMvf X-Proofpoint-ORIG-GUID: Yugv8E0dqdCwSSUqb7OaGltLi84muMvf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=999 clxscore=1015 spamscore=0 bulkscore=0 impostorscore=0 malwarescore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060142 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094035_452251_9E2F7C31 X-CRM114-Status: GOOD ( 13.33 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: If one or more bss from the iface is partnering with bsses from other iface and if this iface gets disabled, then the beacons needs to be refreshed for other ifaces. Similar thing should happen when i [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org If one or more bss from the iface is partnering with bsses from other iface and if this iface gets disabled, then the beacons needs to be refreshed for other ifaces. Similar thing should happen when it gets enabled. Add logic to refresh other iface beacons when one of the iface is disabled or enabled. Signed-off-by: Aditya Kumar Singh --- src/ap/hostapd.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index a8ae0130fef6..0171649b21cc 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -58,6 +58,7 @@ #include "wpa_auth_kay.h" #include "hw_features.h" +static void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface); static int hostapd_flush_old_stations(struct hostapd_data *hapd, u16 reason); #ifdef CONFIG_WEP @@ -3398,6 +3399,8 @@ int hostapd_enable_iface(struct hostapd_iface *hapd_iface) return -1; } + hostapd_refresh_all_iface_beacons(hapd_iface); + return 0; } @@ -3437,6 +3440,22 @@ int hostapd_reload_bss_only(struct hostapd_data *bss) } +static void hostapd_refresh_all_iface_beacons(struct hostapd_iface *hapd_iface) +{ + size_t j; + + if (!hapd_iface || !hapd_iface->interfaces || + hapd_iface->interfaces->count <= 1) + return; + + for (j = 0; j < hapd_iface->interfaces->count; j++) { + if (hapd_iface->interfaces->iface[j] == hapd_iface) + continue; + + ieee802_11_update_beacons(hapd_iface->interfaces->iface[j]); + } +} + int hostapd_disable_iface(struct hostapd_iface *hapd_iface) { size_t j; @@ -3510,6 +3529,7 @@ int hostapd_disable_iface(struct hostapd_iface *hapd_iface) wpa_printf(MSG_DEBUG, "Interface %s disabled", hapd_iface->bss[0]->conf->iface); hostapd_set_state(hapd_iface, HAPD_IFACE_DISABLED); + hostapd_refresh_all_iface_beacons(hapd_iface); return 0; } From patchwork Wed Mar 6 17:39:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=aFzgB2py; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=gri9xIGf; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tqfqv2tL2z1yX4 for ; Thu, 7 Mar 2024 04:41:31 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8hfD26K81EWfhSP73EEwRsVIOygpwDMHLK0TxiMyNVM=; b=aFzgB2pyDFkLts JueSJl1CzatcT4ZjqvjSxNJOtI1h4HHaDoaOtN0/AtfGlDToqxM2isLaidZxWPKNk+Rrlk0K6VVHh z/9u0BQ85idRy0grkyNzQeiTVHxIfcWXJ/bZl3GTgUw/+doYRE0/UykBPjCKX/+9HNT3zGzP9WLR6 h5cVcRXpzJZYyOw2TxNbK2KbSiJWhK4LF3fm25QE/Fb7+8LkUxAl3qw05BcmwUVFFZpGNYC2gci79 zOksegSZJW7tCdsYNOeXt3GKvtOKj1u3Tw9rbic9aVAyqyIFxVRocKv7qFoH9WZeCEHBmLnAJdivA AB/L9AWUj9OgZkb5zaJQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvGG-00000001E73-0iqH; Wed, 06 Mar 2024 17:41:00 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFt-00000001Dpp-3KGw for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:40 +0000 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4266q7Ep010054 for ; Wed, 6 Mar 2024 17:40:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=B5kp0ifbTu59WKRyOfVWrHiSvCYPKueu/LJZv6b9QuM=; b=gr i9xIGfOtAizsI7giHj+ccyRGzgjw5ezRWKrgnZE8VIpSj31xINiyekXlqIQzXh6P xl/T8ZFqYXVUSFH+KXEdnfp5CxSS580dY2YfTt81VbVGyd59jCLUe8C87MK3id9L A1wcGND1XvndkJTtGfNe/zvMP1+Q1zEMHEUXu2My9m3R8N3hAraHbeGs8QxzfsaO fvFjyV0SZYquYuyjF23JpuvVnlMi7aw17N67xzbJR0mPRrIWoNVOpCLQBuolkf1U OY9aZUUNNVQnib+agPuwoLDRrE9qkgkzkgk8TI9Z+1XxTip+bMdS8zAmuteDgj/A 2Go/gbITjKPCDM83803A== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpkkase5f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:36 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeZg8017809 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:35 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:33 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 13/16] hostapd: MLO: fix advertisement of MLD capabilities Date: Wed, 6 Mar 2024 23:09:44 +0530 Message-ID: <20240306173947.2611965-14-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: tzBLSFI4Jg2rjZswKuTkcZiS4Rp4pAoE X-Proofpoint-GUID: tzBLSFI4Jg2rjZswKuTkcZiS4Rp4pAoE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094038_511968_BE75D5C3 X-CRM114-Status: GOOD ( 20.79 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently, hostapd directly advertises the MLD capabilities received from the driver. Since this info is exchanged during init time only, driver will advertise the max supported possible values. Hosta [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently, hostapd directly advertises the MLD capabilities received from the driver. Since this info is exchanged during init time only, driver will advertise the max supported possible values. Hostapd should parse it and then based on current situation should fill the values accordingly. For example, Max number of simultaneous links is supposed to be value between 0 and 14, which is the number of affiliated APs minus 1. Driver advertises this value as 5 and hostapd, irrespective of current active links, it puts 5 in the frames. Fix this issue by parsing the value and at the same time using the values as per the current situation of the links. The advertised values will be used as the upper limit. While at it, also print the MLD capabilities in debug print. Signed-off-by: Aditya Kumar Singh --- src/ap/ieee802_11_eht.c | 30 ++++++++++++++++++++++++++---- src/common/ieee802_11_defs.h | 5 +++++ src/drivers/driver_nl80211_capa.c | 4 ++++ 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c index 826edc5029d8..c908f9a1af08 100644 --- a/src/ap/ieee802_11_eht.c +++ b/src/ap/ieee802_11_eht.c @@ -452,13 +452,13 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, bool include_mld_id) { struct wpabuf *buf; - u16 control; + u16 control, mld_cap; u8 *pos = eid; const u8 *ptr; size_t len, slice_len; u8 link_id; u8 common_info_len; - + u8 max_simul_links, tid_to_link_map, active_links; /* * As the Multi-Link element can exceed the size of 255 bytes need to * first build it and then handle fragmentation. @@ -507,9 +507,31 @@ static u8 * hostapd_eid_eht_basic_ml_common(struct hostapd_data *hapd, hapd->iface->mld_eml_capa); wpabuf_put_le16(buf, hapd->iface->mld_eml_capa); + mld_cap = hapd->iface->mld_mld_capa; + max_simul_links = mld_cap & MLE_MLD_CAP_MAX_SIMULTANEOUS_LINK_MASK; + tid_to_link_map = (mld_cap & MLE_MLD_CAP_TID_TO_LINK_MAP_MASK) >> + MLE_MLD_CAP_TID_TO_LINK_MAP_SHIFT; + active_links = hapd->mld->num_links - 1; + + if (active_links > max_simul_links) { + wpa_printf(MSG_ERROR, + "MLD: Error in max simultaneous links, advertised: 0x%x current: 0x%x", + max_simul_links, active_links); + active_links = max_simul_links; + } + + mld_cap &= ~MLE_MLD_CAP_MAX_SIMULTANEOUS_LINK_MASK; + mld_cap |= (active_links & MLE_MLD_CAP_MAX_SIMULTANEOUS_LINK_MASK); + + /* TODO: advertise T2LM based on driver support as well */ + tid_to_link_map = MLE_MLD_CAP_TID_TO_LINK_MAP_DISABLED; + + mld_cap &= ~MLE_MLD_CAP_TID_TO_LINK_MAP_MASK; + mld_cap |= (tid_to_link_map << MLE_MLD_CAP_TID_TO_LINK_MAP_SHIFT); + wpa_printf(MSG_DEBUG, "MLD: MLD Capabilities and Operations=0x%x", - hapd->iface->mld_mld_capa); - wpabuf_put_le16(buf, hapd->iface->mld_mld_capa); + mld_cap); + wpabuf_put_le16(buf, mld_cap); if (include_mld_id) { wpa_printf(MSG_DEBUG, "MLD: AP MLD ID=0x%x", diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h index d070e42b875d..f2b7fa33a767 100644 --- a/src/common/ieee802_11_defs.h +++ b/src/common/ieee802_11_defs.h @@ -2719,6 +2719,11 @@ struct ieee80211_eht_capabilities { #define BASIC_MULTI_LINK_CTRL_PRES_MLD_CAPA 0x0100 #define BASIC_MULTI_LINK_CTRL_PRES_AP_MLD_ID 0x0200 +#define MLE_MLD_CAP_MAX_SIMULTANEOUS_LINK_MASK ((u8)(BIT(0) | BIT(1) | BIT(2) | BIT(3))) +#define MLE_MLD_CAP_TID_TO_LINK_MAP_SHIFT 5 +#define MLE_MLD_CAP_TID_TO_LINK_MAP_MASK ((u8)(BIT(5) | BIT(6))) +#define MLE_MLD_CAP_TID_TO_LINK_MAP_DISABLED 0 + /* * STA Control field definitions of Per-STA Profile subelement in Basic * Multi-Link element as described in Figure 9-1002n: STA Control field format. diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c index 3bcd66c24533..65389d2069c0 100644 --- a/src/drivers/driver_nl80211_capa.c +++ b/src/drivers/driver_nl80211_capa.c @@ -889,6 +889,10 @@ static void wiphy_info_extended_capab(struct wpa_driver_nl80211_data *drv, nla_get_u16(tb1[NL80211_ATTR_MLD_CAPA_AND_OPS]); } + wpa_printf(MSG_DEBUG, + "nl80211: EML Capability: 0x%x MLD Capability: 0x%x", + capa->eml_capa, capa->mld_capa_and_ops); + drv->num_iface_capa++; if (drv->num_iface_capa == NL80211_IFTYPE_MAX) break; From patchwork Wed Mar 6 17:39:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908966 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Jmyr+2q9; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=E2Z+wymH; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Tqfr21YyYz1yX4 for ; Thu, 7 Mar 2024 04:41:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AxC5XUbtDyouwC0T9lqlR1tQjscKLR4QfCEw6c25a7w=; b=Jmyr+2q9seyOkt hg93vZ1HMOJwtKwLv1+uetxdz85ydyUouHL5vmBwY3YTiCgdPZCxWLyti4S7PHpDqWGLLGG59jx31 BC1Z3F9j4A7r3N/0wpFpq8LiTJxrMfCuqr8ITPhFc2DyNyuqSDctmf5lk6HOO3j16V1GeP4FEyuk7 CDMWR2WcRk22I0oQ2ByQoBYeS9QOtppk0mP3MIjfxDUkGLcIHMaVobqoGUIIQxDj91Ipr3tva3AtX VE7LGlrcvZ85e9LPJsA9fkh5mY7clrRYCQ1bg+X2r+sBO8pjMtdO6HxMxbGJ0v+ufMrw+t3xvo3y3 JmofuSynanA0UBD53J1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvGO-00000001EDZ-08mU; Wed, 06 Mar 2024 17:41:08 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFv-00000001Dqu-0xzQ for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:41 +0000 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426BPY8e029850 for ; Wed, 6 Mar 2024 17:40:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=MFIAGZ7ZiFogmpl2ow77ILaTVrpQuw0ZrWMCTd6I7Ow=; b=E2 Z+wymHPD2i2LGsluyCt1WoY7zXFne7vo+dePmfxK7J4eTtobe/VVm5vut1RQvCuY 1ULG1PCjNFd3Pmc2cHYHpHK/3CoTIbw9WHazsz8tFgrtYXu9cUHBa65+dY98OSJt Iyg93qKq1g0d+3LZY3e2OyTHzvCO4QQAWNcEWZ3bYGMI4XiA/PLaIpkY81ncv/eR Jp+keDaA9e0enatPltlbEbpc7EY7frbxuRJcyJWhqWwxn9MAkcQMlLNMyrvG01Ai nvbLJctZksww3xeYUKjLtHBfY0bjovtZh8dudXvS14QxqwxPislMdmOvxuCg5hXw SDy17BSrxuM8k407z+2w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpkkase5g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:38 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426Hebav032642 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:37 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:35 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 14/16] hostapd: MLO: de-initialize/disable link BSS properly Date: Wed, 6 Mar 2024 23:09:45 +0530 Message-ID: <20240306173947.2611965-15-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 6xRkK7OYVyeJ6tiazqZ6fAh5BhV6YaYE X-Proofpoint-GUID: 6xRkK7OYVyeJ6tiazqZ6fAh5BhV6YaYE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094039_682477_14FA9047 X-CRM114-Status: GOOD ( 31.63 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently, if first link BSS of an interface is getting de-initialized/ disabled, then whole MLD is brought down. All other links are made to stop beaconing and links are removed. And if, non-first li [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently, if first link BSS of an interface is getting de-initialized/ disabled, then whole MLD is brought down. All other links are made to stop beaconing and links are removed. And if, non-first link BSS is de-initialized/disabled, nothing happens. Even beaconing is not stopped which is wrong. Fix the above by properly bringing down the intended link alone from the interface. Signed-off-by: Aditya Kumar Singh --- hostapd/main.c | 1 + src/ap/hostapd.c | 100 +++++++++++++++++++++-------------- src/drivers/driver.h | 13 +++++ src/drivers/driver_nl80211.c | 33 ++++++++++++ 4 files changed, 107 insertions(+), 40 deletions(-) diff --git a/hostapd/main.c b/hostapd/main.c index 97e9704c7046..1ac9b4be30fc 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -195,6 +195,7 @@ static int hostapd_driver_init(struct hostapd_iface *iface) } hapd->drv_priv = h_hapd->drv_priv; + hapd->interface_added = h_hapd->interface_added; /* * All interfaces participating in the AP MLD would have diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 0171649b21cc..9dd9e6c3fd8d 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -401,28 +401,6 @@ static int hostapd_broadcast_wep_set(struct hostapd_data *hapd) #endif /* CONFIG_WEP */ - -static void hostapd_clear_drv_priv(struct hostapd_data *hapd) -{ -#ifdef CONFIG_IEEE80211BE - unsigned int i; - - for (i = 0; i < hapd->iface->interfaces->count; i++) { - struct hostapd_iface *iface = hapd->iface->interfaces->iface[i]; - - if (hapd->iface == iface || !iface) - continue; - - if (iface->bss && iface->bss[0] && - hostapd_mld_get_first_bss(iface->bss[0]) == hapd) - iface->bss[0]->drv_priv = NULL; - } -#endif /* CONFIG_IEEE80211BE */ - - hapd->drv_priv = NULL; -} - - #ifdef CONFIG_IEEE80211BE #ifdef CONFIG_TESTING_OPTIONS @@ -561,10 +539,22 @@ void hostapd_free_hapd_data(struct hostapd_data *hapd) * driver wrapper may have removed its internal instance * and hapd->drv_priv is not valid anymore. */ - hostapd_clear_drv_priv(hapd); + hapd->drv_priv = NULL; } } +#ifdef CONFIG_IEEE80211BE + /* If interface was not added as well as it is not the first bss, then + * at least link should be removed here since deinit will take care only + * for the first bss. + */ + if (hapd->conf->mld_ap && !hapd->interface_added && + hapd->iface->bss[0] != hapd) { + hostapd_if_link_remove(hapd, WPA_IF_AP_BSS, hapd->conf->iface, + hapd->mld_link_id); + } +#endif /* CONFIG_IEEE80211BE */ + wpabuf_free(hapd->time_adv); hapd->time_adv = NULL; @@ -3305,6 +3295,41 @@ hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy, return iface; } +static void hostapd_cleanup_driver(const struct wpa_driver_ops *driver, + void *drv_priv, + struct hostapd_iface *iface) +{ + bool ap_mld = false; + + if (!driver || !driver->hapd_deinit || !drv_priv) + return; + +#ifdef CONFIG_IEEE80211BE + ap_mld = !!iface->bss[0]->conf->mld_ap; +#endif /* CONFIG_IEEE80211BE */ + + /* In case of non-ML operation, de-init. But, if ML operation exist, then + * even if thats the last BSS in the interface, the driver (drv) could + * be in use for a different MLD. Hence, need to check if drv is still + * being used by some other bss before de-initiallizing + */ + if (!ap_mld) + driver->hapd_deinit(drv_priv); +#ifdef CONFIG_IEEE80211BE + else if (hostapd_mld_is_first_bss(iface->bss[0]) && + driver->get_drv_shared_status && + !driver->get_drv_shared_status(drv_priv, iface->bss[0])) { + driver->hapd_deinit(drv_priv); + } else if (hostapd_if_link_remove(iface->bss[0], + WPA_IF_AP_BSS, + iface->bss[0]->conf->iface, + iface->bss[0]->mld_link_id)) { + wpa_printf(MSG_WARNING, "Failed to remove BSS interface %s", + iface->bss[0]->conf->iface); + } +#endif /* CONFIG_IEEE80211BE */ + iface->bss[0]->drv_priv = NULL; +} void hostapd_interface_deinit_free(struct hostapd_iface *iface) { @@ -3322,13 +3347,7 @@ void hostapd_interface_deinit_free(struct hostapd_iface *iface) hostapd_interface_deinit(iface); wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); - if (driver && driver->hapd_deinit && drv_priv) { -#ifdef CONFIG_IEEE80211BE - if (hostapd_mld_is_first_bss(iface->bss[0])) -#endif /* CONFIG_IEEE80211BE */ - driver->hapd_deinit(drv_priv); - hostapd_clear_drv_priv(iface->bss[0]); - } + hostapd_cleanup_driver(driver, drv_priv, iface); hostapd_interface_free(iface); } @@ -3341,21 +3360,22 @@ static void hostapd_deinit_driver(const struct wpa_driver_ops *driver, wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); + + hostapd_cleanup_driver(driver, drv_priv, hapd_iface); + if (driver && driver->hapd_deinit && drv_priv) { -#ifdef CONFIG_IEEE80211BE - if (hostapd_mld_is_first_bss(hapd_iface->bss[0])) -#endif /* CONFIG_IEEE80211BE */ - driver->hapd_deinit(drv_priv); for (j = 0; j < hapd_iface->num_bss; j++) { wpa_printf(MSG_DEBUG, "%s:bss[%d]->drv_priv=%p", __func__, (int) j, hapd_iface->bss[j]->drv_priv); - if (hapd_iface->bss[j]->drv_priv == drv_priv) { - hostapd_clear_drv_priv(hapd_iface->bss[j]); - hapd_iface->extended_capa = NULL; - hapd_iface->extended_capa_mask = NULL; - hapd_iface->extended_capa_len = 0; - } + + if (hapd_iface->bss[j]->drv_priv != drv_priv) + continue; + + hapd_iface->bss[j]->drv_priv = NULL; + hapd_iface->extended_capa = NULL; + hapd_iface->extended_capa_mask = NULL; + hapd_iface->extended_capa_len = 0; } } } diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 6616397fb5d9..d50cbcdb26d1 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -5154,6 +5154,19 @@ struct wpa_driver_ops { */ int (*if_link_remove)(void *priv, enum wpa_driver_if_type type, const char *ifname, s8 link_id); + + /** + * get_drv_shared_status - Get shared status of driver interface + * @priv: private driver interface data from init() + * @bss_ctx: BSS context for %WPA_IF_AP_BSS interfaces + * + * Checks whether driver interface is being used by other partner + * BSS(s) or not. This is used to decide whether driver interface + * needs to be deinitilized when one iface is getting deinitialized. + * + * Returns: True if it is being used or else False. + */ + bool (*get_drv_shared_status)(void *priv, void *bss_ctx); #endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_TESTING_OPTIONS diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index d5f7cc7d041c..a0616ce39192 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -10755,6 +10755,38 @@ static int driver_nl80211_if_link_remove(void *priv, enum wpa_driver_if_type typ return wpa_driver_nl80211_if_link_remove(bss, type, ifname, link_id); } + +static bool wpa_driver_get_shared_status(void *priv, void *bss_ctx) +{ + struct i802_bss *bss = priv; + struct wpa_driver_nl80211_data *drv = bss->drv; + int num_bss = 0; + + /* If any other bss exist, means someone else is using since at this + * time, we would have removed all bss created by this driver and only + * this bss should be remaining if driver is not shared by anyone + */ + for (bss = drv->first_bss; bss; bss = bss->next) + num_bss++; + + if (num_bss > 1) + return true; + + /* This is the only bss present */ + bss = priv; + + /* If only one/no link is there then no one is sharing */ + if (bss->valid_links <= 1) + return false; + + /* More than one links means some one is still using. To check if + * only 1 bit is set, power of 2 condition can be checked + */ + if (!(bss->valid_links & (bss->valid_links - 1))) + return false; + + return true; +} #endif /* CONFIG_IEEE80211BE */ static int driver_nl80211_send_mlme(void *priv, const u8 *data, @@ -14087,6 +14119,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { .link_add = nl80211_link_add, #ifdef CONFIG_IEEE80211BE .if_link_remove = driver_nl80211_if_link_remove, + .get_drv_shared_status = wpa_driver_get_shared_status, #endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_TESTING_OPTIONS .register_frame = testing_nl80211_register_frame, From patchwork Wed Mar 6 17:39:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=C/RA+6Gi; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=ZlOxAR04; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqhP03Xchz1yXC for ; Thu, 7 Mar 2024 05:51:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LfuNvlNRYMqOL4GxJIjNh/Y3EMC5mOQJ2wiXY8sb+/0=; b=C/RA+6GiNpKTfc PdvqrzUQLbwk8pKPnzg5EqBkucv2fBKwMcN5oG9toCLjrCy+yUY+TZLDMQGstZ3lpPSgxEH191t8s vcro6eBWODD68R2nDf4iBJMTG6saagJWIfF7Ng99axSVfQv4zznVxZBGGMzaReWfJC1eWOBTt1upT imsGIvxTW2BwxPQApLhsZIN/CNjLffOZl2GkEiGKpqBWX9VIfRGfhPhuHer7n4FyJxxRxxL5+3ars hJzzCv0MjClP6GXi86P9yfZ/owAqrbdfMqkn9f4P45ZMDQPSM2Rh84K7OSHhmhdVHMFnJ1kLXicFo iXriSE8oOxk9TTulyHRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhwMR-00000001X9v-1FJi; Wed, 06 Mar 2024 18:51:27 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFx-00000001Dsb-0Dyl for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:43 +0000 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426D3KM0003013 for ; Wed, 6 Mar 2024 17:40:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=9gZJNJwWwEA0Ksd3/OrHzrnNcsO8RPAaXus9Im11HEI=; b=Zl OxAR04EZmBxdUIYXJao5kxdnuY1bu0A5ferWhRf1SJIKrAIqc4Jyj3hbvPkbyQ9s pja7ZujvapOx2FRCiFov3ksOoWo5rY6RUlDgTVqm40k7bBtxg8Ujjbwvr8y30tL2 5dFGNv/l7Vz7fNpe3P8lNJPGSb+Zpn+SOro2GKTZ6vdX/ClIaAZGcPs9mZmE9/Hz gI8HR/YAb+V86EsJlWg/WLpxmFINMjbaj+WS1XwLf5NKyDnMTKsBGqq4iru25lb2 7x2tYtTlXrUZs32ZlIJfRcSmUYy+uu5M1kJiieZXA0RwiY9hheFBLIkLUUZy8Q1T K1FY8VkMB3/lnutLJuTw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpkkase5k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:39 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426Hect0032652 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:38 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:37 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 15/16] hostapd: MLD: add support to remove link station from AP Date: Wed, 6 Mar 2024 23:09:46 +0530 Message-ID: <20240306173947.2611965-16-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: QHwvEhhJPWNQgFqAdwvoXpw2cKr0nH6X X-Proofpoint-GUID: QHwvEhhJPWNQgFqAdwvoXpw2cKr0nH6X X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 lowpriorityscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094041_342181_316AA3B0 X-CRM114-Status: GOOD ( 22.67 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently, whenever ap_free_sta() is called, it deletes the whole station entry from kernel as well. However, with MLD station, there is a requirement to delete only the link station. Add support to remove link station alone from a MLD station. If the link going to be removed is the assoc link, then whole station entry will be removed. Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently, whenever ap_free_sta() is called, it deletes the whole station entry from kernel as well. However, with MLD station, there is a requirement to delete only the link station. Add support to remove link station alone from a MLD station. If the link going to be removed is the assoc link, then whole station entry will be removed. Signed-off-by: Aditya Kumar Singh --- src/ap/ap_drv_ops.c | 4 ++-- src/ap/ap_drv_ops.h | 14 ++++++++++++++ src/ap/hostapd.c | 1 + src/ap/sta_info.c | 33 ++++++++++++++++++++++++++++++++- src/ap/sta_info.h | 4 ++++ src/drivers/driver.h | 9 +++++++++ src/drivers/driver_nl80211.c | 29 +++++++++++++++++++++++++++++ 7 files changed, 91 insertions(+), 3 deletions(-) diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index 5dfcdac3a137..587d42ee82f7 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -265,8 +265,8 @@ int hostapd_set_ap_wps_ie(struct hostapd_data *hapd) } -static bool hostapd_sta_is_link_sta(struct hostapd_data *hapd, - struct sta_info *sta) +bool hostapd_sta_is_link_sta(struct hostapd_data *hapd, + struct sta_info *sta) { #ifdef CONFIG_IEEE80211BE if (ap_sta_is_mld(hapd, sta) && diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h index 9c74ef579b2f..b321f9847463 100644 --- a/src/ap/ap_drv_ops.h +++ b/src/ap/ap_drv_ops.h @@ -459,8 +459,22 @@ static inline int hostapd_drv_link_add(struct hostapd_data *hapd, } +static inline int hostapd_drv_link_sta_remove(struct hostapd_data *hapd, + const u8 *addr) +{ + if (!hapd->conf->mld_ap || !hapd->driver || !hapd->drv_priv || + !hapd->driver->link_sta_remove) + return -1; + + return hapd->driver->link_sta_remove(hapd->drv_priv, + hapd->mld_link_id, addr); +} + int hostapd_if_link_remove(struct hostapd_data *hapd, enum wpa_driver_if_type type, const char *ifname, u8 link_id); #endif /* CONFIG_IEEE80211BE */ +bool hostapd_sta_is_link_sta(struct hostapd_data *hapd, + struct sta_info *sta); + #endif /* AP_DRV_OPS */ diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 9dd9e6c3fd8d..863547c0de33 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -422,6 +422,7 @@ static void hostapd_link_remove_timeout_handler(void *eloop_data, ieee802_11_set_beacon(hapd); if (!hapd->eht_mld_link_removal_count) { + hostapd_free_link_stas(hapd); hostapd_disable_iface(hapd->iface); return; } diff --git a/src/ap/sta_info.c b/src/ap/sta_info.c index 97ed805ca5c2..22d17c53bce3 100644 --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c @@ -187,6 +187,17 @@ void ap_free_sta_pasn(struct hostapd_data *hapd, struct sta_info *sta) #endif /* CONFIG_PASN */ +static void __ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta) +{ +#ifdef CONFIG_IEEE80211BE + if (hostapd_sta_is_link_sta(hapd, sta)) + if (!hostapd_drv_link_sta_remove(hapd, sta->addr)) + return; +#endif /* CONFIG_IEEE80211BE */ + + hostapd_drv_sta_remove(hapd, sta->addr); +} + void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta) { int set_beacon = 0; @@ -209,7 +220,7 @@ void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta) if (!hapd->iface->driver_ap_teardown && !(sta->flags & WLAN_STA_PREAUTH)) { - hostapd_drv_sta_remove(hapd, sta->addr); + __ap_free_sta(hapd, sta); sta->added_unassoc = 0; } @@ -453,6 +464,26 @@ void hostapd_free_stas(struct hostapd_data *hapd) } } +#ifdef CONFIG_IEEE80211BE +void hostapd_free_link_stas(struct hostapd_data *hapd) +{ + struct sta_info *sta, *prev; + + sta = hapd->sta_list; + + while (sta) { + prev = sta; + sta = sta->next; + + if (!hostapd_sta_is_link_sta(hapd, prev)) + continue; + + wpa_printf(MSG_DEBUG, "Removing link station from MLD " MACSTR, + MAC2STR(prev->addr)); + ap_free_sta(hapd, prev); + } +} +#endif /* CONFIG_IEEE80211BE */ /** * ap_handle_timer - Per STA timer handler diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h index b136ff7bfab8..546e42973a44 100644 --- a/src/ap/sta_info.h +++ b/src/ap/sta_info.h @@ -440,4 +440,8 @@ static inline void ap_sta_set_mld(struct sta_info *sta, bool mld) void ap_sta_free_sta_profile(struct mld_info *info); +#ifdef CONFIG_IEEE80211BE +void hostapd_free_link_stas(struct hostapd_data *hapd); +#endif /* CONFIG_IEEE80211BE */ + #endif /* STA_INFO_H */ diff --git a/src/drivers/driver.h b/src/drivers/driver.h index d50cbcdb26d1..e45fac77e187 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -5167,6 +5167,15 @@ struct wpa_driver_ops { * Returns: True if it is being used or else False. */ bool (*get_drv_shared_status)(void *priv, void *bss_ctx); + + /** + * link_sta_remove - Remove a link STA from a MLD STA. + * @priv: Private driver interface data + * @link_id: The link ID which the link STA is using + * @addr: The MLD MAC address of the MLD STA + * Returns: 0 on success, negative value on failure + */ + int (*link_sta_remove)(void *priv, u8 link_id, const u8 *addr); #endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_TESTING_OPTIONS diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index a0616ce39192..0f83621eca35 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -13922,6 +13922,34 @@ static int nl80211_link_add(void *priv, u8 link_id, const u8 *addr, void *bss_ct return 0; } +#ifdef CONFIG_IEEE80211BE +static int wpa_driver_nl80211_link_sta_remove(void *priv, u8 link_id, + const u8 *addr) +{ + struct i802_bss *bss = priv; + struct wpa_driver_nl80211_data *drv = bss->drv; + struct nl_msg *msg; + int ret; + + if (!(bss->valid_links & BIT(link_id))) + return -ENOLINK; + + if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_REMOVE_LINK_STA)) || + nla_put(msg, NL80211_ATTR_MLD_ADDR, ETH_ALEN, addr) || + nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) { + nlmsg_free(msg); + return -ENOBUFS; + } + + ret = send_and_recv_cmd(drv, msg); + wpa_printf(MSG_DEBUG, + "nl80211: link_sta_remove -> REMOVE_LINK_STA on link_id %u " + "from MLD STA " MACSTR ", from %s --> %d (%s)", + link_id, MAC2STR(addr), bss->ifname, ret, strerror(-ret)); + + return ret; +} +#endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_TESTING_OPTIONS @@ -14120,6 +14148,7 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = { #ifdef CONFIG_IEEE80211BE .if_link_remove = driver_nl80211_if_link_remove, .get_drv_shared_status = wpa_driver_get_shared_status, + .link_sta_remove = wpa_driver_nl80211_link_sta_remove, #endif /* CONFIG_IEEE80211BE */ #ifdef CONFIG_TESTING_OPTIONS .register_frame = testing_nl80211_register_frame, From patchwork Wed Mar 6 17:39:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 1908992 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=e9FvyEtD; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=V02fU+YE; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TqhP03KC8z1yX4 for ; Thu, 7 Mar 2024 05:51:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wcdMmTDa2HFSt8paCdt0a5cask4bpaIvDcKD+ys2wmg=; b=e9FvyEtDW3Kbgl qiMds1HStol2MOnfB0rPtyL2l4mlrY0g6BbUOmcns7JXVrOLk75hOBAnUIz1qiLaUth8UOoZkqS28 kI2qHQrH0iQY78b3csBeeFzfz7VEMDWSnR9vf+n3HBJzSFeJeciEP5mIcnFPV1vtBDgBMB+fQoVAX htz4a+0xBKzsbBmA1RMfQ/312a39ynQ5rq0c+Jy/k7XSxOrzi7cUaciSeFLFaNk/fVWPfPkz7AUSd p4wzYDAFJ7f8Zu7l5l4utvHxykauxcjfkV32+M/1ZXrr180bHsA/lHknEVlWuJbaC4x5cRggP4Fd7 /aZeJEYfydw2zf+a9QqQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhwMT-00000001XAO-1fgR; Wed, 06 Mar 2024 18:51:29 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhvFy-00000001Dtu-3qmT for hostap@lists.infradead.org; Wed, 06 Mar 2024 17:40:45 +0000 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 426ATL5O019363 for ; Wed, 6 Mar 2024 17:40:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=vW8B5oIreaS73qlKgznDY898gQtbJzjPbkEgIV0HIyQ=; b=V0 2fU+YEcdq5Yw4PYQI3kOba2V874ezCRlJDI3g2CA6d+sG2WsnW8ThWdlAdrDp6bS YbjuK4e9gGA4O7Askz5LhujOhH8XlUvqcv5O3U/UrfWp4mWslkEDpTuyUL30xKp1 /uAThSzKbWlOgCSm3gML+FL34oErXios3RPoa6m1A7fQXqDYQmhu2ee/jvAwBKLA 2ueQadjrFy+MbZdLXkvvsRt+tCHYFea2cHLOJDuIyRa6NhY+klytVY98Ct8Z+R7K Lp/tmH2cmoXCcs/RYEdRCnck868/LP3Rsu7rEmXbW8vTKGphMqYWtcF83Ib0APCP 2bR9cz7vCOHWsmvlxE3g== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wpjy3sfrd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 06 Mar 2024 17:40:41 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 426HeeSm018002 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 6 Mar 2024 17:40:40 GMT Received: from cdcwlex322514-lin.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 6 Mar 2024 09:40:38 -0800 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH 16/16] hostapd: MLD: remove restriction of disabling first link bss at last Date: Wed, 6 Mar 2024 23:09:47 +0530 Message-ID: <20240306173947.2611965-17-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240306173947.2611965-1-quic_adisi@quicinc.com> References: <20240306173947.2611965-1-quic_adisi@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: nHe2sxAldlNgF9xQPxFSA9jwMzJDcjDh X-Proofpoint-ORIG-GUID: nHe2sxAldlNgF9xQPxFSA9jwMzJDcjDh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-06_11,2024-03-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 malwarescore=0 mlxscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403060143 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240306_094043_225336_B7FC53D3 X-CRM114-Status: GOOD ( 15.02 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Currently first link BSS is always disabled at last. However, now first BSS can be dynamically adjusted. Hence remove such restriction. Signed-off-by: Aditya Kumar Singh --- hostapd/ctrl_iface.c | 17 + src/ap/hostapd.c | 24 2 files changed, 1 insertion(+), 40 deletions( [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 T_SCC_BODY_TEXT_LINE No description available. X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently first link BSS is always disabled at last. However, now first BSS can be dynamically adjusted. Hence remove such restriction. Signed-off-by: Aditya Kumar Singh --- hostapd/ctrl_iface.c | 17 +---------------- src/ap/hostapd.c | 24 ------------------------ 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/hostapd/ctrl_iface.c b/hostapd/ctrl_iface.c index 714d09837605..300042848bab 100644 --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c @@ -3503,7 +3503,6 @@ static void hostapd_disable_iface_bss(struct hostapd_iface *iface) static int hostapd_ctrl_iface_disable_mld(struct hostapd_iface *iface) { unsigned int i; - struct hostapd_iface *first_iface = NULL; if (!iface || !iface->bss[0]->conf->mld_ap) { wpa_printf(MSG_ERROR, @@ -3523,26 +3522,17 @@ static int hostapd_ctrl_iface_disable_mld(struct hostapd_iface *iface) !hostapd_is_ml_partner(h_hapd, iface->bss[0])) continue; - if (hostapd_mld_is_first_bss(h_hapd)) { - first_iface = h_iface; - continue; - } hostapd_disable_iface_bss(iface); } - if (first_iface) - hostapd_disable_iface_bss(first_iface); - /* Then, fully disable interfaces */ - for (i = 0; i < iface->interfaces->count; ++i) { struct hostapd_iface *h_iface = iface->interfaces->iface[i]; struct hostapd_data *h_hapd = h_iface->bss[0]; struct hostapd_bss_config *h_conf = h_hapd->conf; if (!h_conf->mld_ap || - !hostapd_is_ml_partner(h_hapd, iface->bss[0]) || - hostapd_mld_is_first_bss(h_hapd)) + !hostapd_is_ml_partner(h_hapd, iface->bss[0])) continue; if (hostapd_disable_iface(h_iface)) { @@ -3551,11 +3541,6 @@ static int hostapd_ctrl_iface_disable_mld(struct hostapd_iface *iface) } } - if (first_iface && hostapd_disable_iface(first_iface)) { - wpa_printf(MSG_ERROR, "Disabling AP MLD failed"); - return -1; - } - return 0; } diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c index 863547c0de33..842a527466c0 100644 --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c @@ -3495,30 +3495,6 @@ int hostapd_disable_iface(struct hostapd_iface *hapd_iface) return -1; } -#ifdef CONFIG_IEEE80211BE - if (hapd_iface->bss[0]->conf->mld_ap && - hostapd_mld_is_first_bss((hapd_iface->bss[0]))) { - /* Do not allow mld_first_bss disabling before other BSSs */ - for (j = 0; j < hapd_iface->interfaces->count; ++j) { - struct hostapd_iface *h_iface = - hapd_iface->interfaces->iface[j]; - struct hostapd_data *h_hapd = h_iface->bss[0]; - struct hostapd_bss_config *h_conf = h_hapd->conf; - - if (!h_conf->mld_ap || - !hostapd_is_ml_partner(h_hapd, hapd_iface->bss[0]) || - h_iface == hapd_iface) - continue; - - if (h_iface->state != HAPD_IFACE_DISABLED) { - wpa_printf(MSG_INFO, - "Do not allow disable mld_first_bss first"); - return -1; - } - } - } -#endif /* CONFIG_IEEE80211BE */ - wpa_msg(hapd_iface->bss[0]->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); driver = hapd_iface->bss[0]->driver; drv_priv = hapd_iface->bss[0]->drv_priv;