openwrt/package/network/services/hostapd/patches/030-driver_nl80211-rewrite-...

276 lines
6.9 KiB
Diff
Raw Normal View History

From: Felix Fietkau <nbd@nbd.name>
Date: Wed, 28 Jul 2021 05:49:46 +0200
Subject: [PATCH] driver_nl80211: rewrite neigh code to not depend on
libnl3-route
Removes an unnecessary dependency and also makes the code smaller
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -16,9 +16,6 @@
#include <net/if.h>
#include <netlink/genl/genl.h>
#include <netlink/genl/ctrl.h>
-#ifdef CONFIG_LIBNL3_ROUTE
-#include <netlink/route/neighbour.h>
-#endif /* CONFIG_LIBNL3_ROUTE */
#include <linux/rtnetlink.h>
#include <netpacket/packet.h>
#include <linux/errqueue.h>
@@ -5783,26 +5780,29 @@ fail:
static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr)
{
-#ifdef CONFIG_LIBNL3_ROUTE
struct wpa_driver_nl80211_data *drv = bss->drv;
- struct rtnl_neigh *rn;
- struct nl_addr *nl_addr;
+ struct ndmsg nhdr = {
+ .ndm_state = NUD_PERMANENT,
+ .ndm_ifindex = bss->ifindex,
+ .ndm_family = AF_BRIDGE,
+ };
+ struct nl_msg *msg;
int err;
- rn = rtnl_neigh_alloc();
- if (!rn)
+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
+ if (!msg)
return;
- rtnl_neigh_set_family(rn, AF_BRIDGE);
- rtnl_neigh_set_ifindex(rn, bss->ifindex);
- nl_addr = nl_addr_build(AF_BRIDGE, (void *) addr, ETH_ALEN);
- if (!nl_addr) {
- rtnl_neigh_put(rn);
- return;
- }
- rtnl_neigh_set_lladdr(rn, nl_addr);
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
+ goto errout;
+
+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
+ goto errout;
+
+ if (nl_send_auto_complete(drv->rtnl_sk, msg) < 0)
+ goto errout;
- err = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
+ err = nl_wait_for_ack(drv->rtnl_sk);
if (err < 0) {
wpa_printf(MSG_DEBUG, "nl80211: bridge FDB entry delete for "
MACSTR " ifindex=%d failed: %s", MAC2STR(addr),
@@ -5812,9 +5812,8 @@ static void rtnl_neigh_delete_fdb_entry(
MACSTR, MAC2STR(addr));
}
- nl_addr_put(nl_addr);
- rtnl_neigh_put(rn);
-#endif /* CONFIG_LIBNL3_ROUTE */
+errout:
+ nlmsg_free(msg);
}
@@ -8492,7 +8491,6 @@ static void *i802_init(struct hostapd_da
(params->num_bridge == 0 || !params->bridge[0]))
add_ifidx(drv, br_ifindex, drv->ifindex);
-#ifdef CONFIG_LIBNL3_ROUTE
if (bss->added_if_into_bridge || bss->already_in_bridge) {
int err;
@@ -8509,7 +8507,6 @@ static void *i802_init(struct hostapd_da
goto failed;
}
}
-#endif /* CONFIG_LIBNL3_ROUTE */
if (drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) {
wpa_printf(MSG_DEBUG,
hostapd: update to the latest version 8e6485a1bcb0 PEAP client: Update Phase 2 authentication requirements de9a11f4dde9 TTLS client: Support phase2_auth=2 b2a1e7fe7ab9 tests: PEAP and TTLS phase2_auth behavior 518ae8c7cca8 P2P: Do not print control characters in debug a4c133ea73c7 WPS: Optimize attribute parsing workaround 7a37a94eaa0d Check whether element parsing has failed f80d83368818 ACS: Remove invalid debug print fb2b7858a728 FILS: Fix HE MCS field initialization 50ee26fc7044 P2P: Check p2p_channel_select() return value a50d1ea6a2b3 Add QCA vendor attributes for user defined power save parameters 4636476b7f22 Set RRM used config if the (Re)Association Request frame has RRM IE e53d44ac63e8 AP MLD: Use STA assoc link address in external auth status to the driver 99a96b2f9df7 AP MLD: OWE when SME is offloaded to the driver 96deacf5d710 nl80211: Skip STA MLO link channel switch handling in AP mode d320692d918a AP MLD: Handle new STA event when using SME offload to the driver faee8b99e928 tests: Fix eht_mld_sae_legacy_client to restore sae_pwe c3f465c56c94 wlantest: Handle variable length MIC field in EAPOL-Key with OWE 605034240e0c wlantest: Support multiple input files 053bd8af8ed2 Recognize FTE MLO subelements 43b5f11d969a Defragmentation of FTE 3973300b8ded FTE protected element check for MLO Reassociation Response frame 74e4a0a6f1e4 wlantest: Learn AP MLD MAC address from Beacon frames a5a0b2cf7b1b wlantest: Find non-AP MLD only from affiliated BSSs of the AP MLD 74472758584d wlantest: Recognize non-AP MLD based on any link address for decryption 1ffabd697c67 wlantest: Learn non-AP MLD MAC address from (Re)Association Request frames 4e8e515f92b9 wlantest: Use MLO search for the STA in reassociation 49bf9f2df95a wlantest: Use the MLD MAC address as well for matching STA entries 5434a42ec69c wlantest: Search for FT Target AP using MLD MAC address as well a19fcf685cae wlantest: Include the MLD MAC address of the AP MLD in new-STA prints 709d46da73da wlantest: Do not claim update to AP MD MAC address if no change 770760454f9e wlantest: Do not update BSS entries for other AP MLDs in PTK cloning 084745ffc508 Add QCA vendor attributes for NDP setup bf9cbb462fd9 Fix writing of BIGTK in FT protocol 011775af9443 tests: Check for beacon loss when using beacon protection 8f148d51322f Fix a compiler warning on prototype mismatch b7db495ad9c9 AP: Fix ieee802_1x_ml_set_sta_authorized() 232667eafe0d Fix CCMP test vector issues 30771e6e05ed Include PTID in PV1 nonce construction for CCMP test vector 34841cfd9aba Minor formatting changes to CCMP test vectors a685d84139e6 BSS coloring: Fix CCA with multiple BSS bc0636841a70 wpa_supplicant: Fix configuration parsing error for tx_queue_* 2763d1d97e66 hostapd: Fix AID assignment in multiple BSSID 763a19286e2f AP: Add configuration option to specify the desired MLD address bd209633eb10 AP: Use is_zero_ether_addr() to check if BSSID is NULL bc0268d053b4 wlantest: Guess SAE/OWE group from EAPOL-Key length mismatch a94ba5322803 EHT: Support puncturing for 320 MHz channel bandwidth 7e1f5c44c97e EHT: 320 MHz DFS support 6f293b32112a QCA vendor attributes for updating roaming AP BSSID info 5856373554eb Extend QCA vendor command to include more parameters for netdev events e080930aa0a5 Define QCA vendor roam control RSSI attributes fe72afe713ad Define QCA vendor attribute for high RSSI roam trigger threshold 47a65ccbfde2 P2P: Clean wpa_s->last_ssid when removing a temporary group network 884125ab7d21 tests: P2P autonomous GO and clearing of networking information 7637d0f25053 P2P: Do not filter pref_freq_list if the driver does not provide one dd1330b502ff Fix hostapd interface cleanup with multiple interfaces 0a6842d5030e nl80211: Fix beacon rate configuration for legacy rates 36, 48, 54 Mbps d606efe054d5 tests: Beacon rate configuration for 54 Mbps f91d10c0e6aa tests: Update RSA 3k certificates 07d3c1177bbb tests: Make sae_proto_hostapd_status_* more robust 1085e3bdc6f6 Update iface->current_mode when fetching new hw_features 338a78846b44 Add a QCA vendor sub command for transmit latency statistics 9318db7c38bc wlantest: Use local variables for AA/SPA in FT Request/Response processing 628b9f10223d wlantest: Derive PMK-R1 and PTK using AA/SPA for MLO FT over-the-DS 104aa291e5c8 wlantest: Fix FT over-the-DS decryption 37c87efecfe3 wlantest: Search SPA using MLO aware find for FT Request/Response frame 19f33d7929e8 wlantest: Learn the Link ID for AP MLD affiliated BSSs 6ae43bb10323 wlantest: Learn link address for assoc link from (Re)Association Request 4c079dcc64da Increment hmac_sha*_vector() maximum num_elem value to 25 e6f64a8e1daf FT: FTE MIC calculation for MLO Reassociation Request frame a83575df5994 wlantest: FTE MIC calculation for MLO Reassociation Request frames ff02f734baf8 wlantest: Allow specific link BSS to be found with bss_find_mld() 7381c60db8f0 FT: Make FTE MIC calculation more flexible ac9bf1cc2a4c Decrement hmac_sha*_vector() maximum num_elem value to 11 aa08d9d76803 Fix use of defragmented FTE information 78b153f90a74 Calculate defragmented FTE length during IE parsing 8cf919ffd5c4 wlantest: FTE MIC calculation for MLO Reassociation Response frame d12a3dce82a9 wlantest: Store and check SNonce/ANonce for FT Authentication 20febfd7838d wlantest: Dump MLO association information in debug 609864d6a8a1 Add QCA vendor attribute to configure MLD ID in ML probe request 12154861e24a Add support for conversion to little endian for 24 bits c437665041c0 Add Non EHT SCS Capability in (Re)Association Request frames 33da386553b7 SCS: Add support for QoS Characteristics in SCS request edfca280cbe8 SCS: Add support for optional QoS Charateristics parameters 32dcec9529ec Send actual MFP configuration when driver takes care of BSS selection 123d16d860fa Update hw_mode when CSA finishes b3d852560bda Change QCA vendor configure attribution name of peer MAC address 12fabc4765c2 Add QCA vendor attribute for configuring max A-MPDU aggregation count f6eaa7b729cb Add QCA vendor attribute for TTLM negotiation support type f6dcd326fea7 wlantest: Indicate ToDS/FromDS values for BSS DATA entries 6ce745bb87d4 wlantest: MLO support for decrypting 4-address frames 850dc1482953 wlantest: Remove duplicated A1/A2/A3 override detection for MLO 770e5a808fbb wlantest: Determine whether A1 points to STA once in rx_data_bss_prot() 377d617b574a Define new BSS command info mask for AP MLD address d3ab6e001f62 wlantest: Use non-AP MLD's MLD MAC address in FT over-the-air derivation a845601ffe32 wlantest: Derive PTK in MLO using MLD MAC addresses for FT over-the-air 0cd2bfc8a402 wlantest: Fix FTE MIC calculation for MLO Reassociation Response frames 528abdeb673b wlantest: Learn group keys from MLO FT Reassociation Response frames 990600753dd9 wlantest: Defragment Basic MLE before processing de043ec01ab5 wlantest: Defragment the Per-STA Profile subelement bae1ec693c44 wlantest: Minimal parsing of Basic MLE STA Profile ba1579f3bf7c Clear BIGTK values from wpa_supplicant state machine when not needed b46c4b9a916a tests: Beacon protection and reconnection 3e71516936b7 Document per-ESS MAC address (mac_addr=3 and mac_value) f85b2b2dee3b Extend wpa_parse_kde_ies() to include EHT capabilities e3a68081bc1e driver: Add option for link ID to be specified for send_tdls_mgmt() c7561502f2e8 nl80211: Use a QCA vendor command to set the link for TDLS Discovery Response a41c8dbdd84e TDLS: Copy peer's EHT capabilities 626501434be1 TDLS: Learn MLD link ID from TDLS Discovery Response 5f30f62eead7 TDLS: Reply to Discovery Request on the link with matching BSSID 940ef9a05c0f TDLS: Use link-specific BSSID instead of sm->bssid for MLO cases f429064189c3 TDLS: Set EHT/MLO information for TDLS STA into the driver dd25885a9daa Remove space-before-tab in QCA vendor related definitions af6e0306b2a9 Fix typos in QCA vendor related definitions 4c9af238c1e4 Fix inconsistent whitespace use in QCA vendor related definitions e5ccbfc69ecf Split long comment lines in QCA vendor related definitions Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-13 09:00:53 +00:00
@@ -11883,13 +11880,14 @@ static int wpa_driver_br_add_ip_neigh(vo
const u8 *ipaddr, int prefixlen,
const u8 *addr)
{
-#ifdef CONFIG_LIBNL3_ROUTE
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
- struct rtnl_neigh *rn;
- struct nl_addr *nl_ipaddr = NULL;
- struct nl_addr *nl_lladdr = NULL;
- int family, addrsize;
+ struct ndmsg nhdr = {
+ .ndm_state = NUD_PERMANENT,
+ .ndm_ifindex = bss->br_ifindex,
+ };
+ struct nl_msg *msg;
+ int addrsize;
int res;
if (!ipaddr || prefixlen == 0 || !addr)
hostapd: update to the latest version 8e6485a1bcb0 PEAP client: Update Phase 2 authentication requirements de9a11f4dde9 TTLS client: Support phase2_auth=2 b2a1e7fe7ab9 tests: PEAP and TTLS phase2_auth behavior 518ae8c7cca8 P2P: Do not print control characters in debug a4c133ea73c7 WPS: Optimize attribute parsing workaround 7a37a94eaa0d Check whether element parsing has failed f80d83368818 ACS: Remove invalid debug print fb2b7858a728 FILS: Fix HE MCS field initialization 50ee26fc7044 P2P: Check p2p_channel_select() return value a50d1ea6a2b3 Add QCA vendor attributes for user defined power save parameters 4636476b7f22 Set RRM used config if the (Re)Association Request frame has RRM IE e53d44ac63e8 AP MLD: Use STA assoc link address in external auth status to the driver 99a96b2f9df7 AP MLD: OWE when SME is offloaded to the driver 96deacf5d710 nl80211: Skip STA MLO link channel switch handling in AP mode d320692d918a AP MLD: Handle new STA event when using SME offload to the driver faee8b99e928 tests: Fix eht_mld_sae_legacy_client to restore sae_pwe c3f465c56c94 wlantest: Handle variable length MIC field in EAPOL-Key with OWE 605034240e0c wlantest: Support multiple input files 053bd8af8ed2 Recognize FTE MLO subelements 43b5f11d969a Defragmentation of FTE 3973300b8ded FTE protected element check for MLO Reassociation Response frame 74e4a0a6f1e4 wlantest: Learn AP MLD MAC address from Beacon frames a5a0b2cf7b1b wlantest: Find non-AP MLD only from affiliated BSSs of the AP MLD 74472758584d wlantest: Recognize non-AP MLD based on any link address for decryption 1ffabd697c67 wlantest: Learn non-AP MLD MAC address from (Re)Association Request frames 4e8e515f92b9 wlantest: Use MLO search for the STA in reassociation 49bf9f2df95a wlantest: Use the MLD MAC address as well for matching STA entries 5434a42ec69c wlantest: Search for FT Target AP using MLD MAC address as well a19fcf685cae wlantest: Include the MLD MAC address of the AP MLD in new-STA prints 709d46da73da wlantest: Do not claim update to AP MD MAC address if no change 770760454f9e wlantest: Do not update BSS entries for other AP MLDs in PTK cloning 084745ffc508 Add QCA vendor attributes for NDP setup bf9cbb462fd9 Fix writing of BIGTK in FT protocol 011775af9443 tests: Check for beacon loss when using beacon protection 8f148d51322f Fix a compiler warning on prototype mismatch b7db495ad9c9 AP: Fix ieee802_1x_ml_set_sta_authorized() 232667eafe0d Fix CCMP test vector issues 30771e6e05ed Include PTID in PV1 nonce construction for CCMP test vector 34841cfd9aba Minor formatting changes to CCMP test vectors a685d84139e6 BSS coloring: Fix CCA with multiple BSS bc0636841a70 wpa_supplicant: Fix configuration parsing error for tx_queue_* 2763d1d97e66 hostapd: Fix AID assignment in multiple BSSID 763a19286e2f AP: Add configuration option to specify the desired MLD address bd209633eb10 AP: Use is_zero_ether_addr() to check if BSSID is NULL bc0268d053b4 wlantest: Guess SAE/OWE group from EAPOL-Key length mismatch a94ba5322803 EHT: Support puncturing for 320 MHz channel bandwidth 7e1f5c44c97e EHT: 320 MHz DFS support 6f293b32112a QCA vendor attributes for updating roaming AP BSSID info 5856373554eb Extend QCA vendor command to include more parameters for netdev events e080930aa0a5 Define QCA vendor roam control RSSI attributes fe72afe713ad Define QCA vendor attribute for high RSSI roam trigger threshold 47a65ccbfde2 P2P: Clean wpa_s->last_ssid when removing a temporary group network 884125ab7d21 tests: P2P autonomous GO and clearing of networking information 7637d0f25053 P2P: Do not filter pref_freq_list if the driver does not provide one dd1330b502ff Fix hostapd interface cleanup with multiple interfaces 0a6842d5030e nl80211: Fix beacon rate configuration for legacy rates 36, 48, 54 Mbps d606efe054d5 tests: Beacon rate configuration for 54 Mbps f91d10c0e6aa tests: Update RSA 3k certificates 07d3c1177bbb tests: Make sae_proto_hostapd_status_* more robust 1085e3bdc6f6 Update iface->current_mode when fetching new hw_features 338a78846b44 Add a QCA vendor sub command for transmit latency statistics 9318db7c38bc wlantest: Use local variables for AA/SPA in FT Request/Response processing 628b9f10223d wlantest: Derive PMK-R1 and PTK using AA/SPA for MLO FT over-the-DS 104aa291e5c8 wlantest: Fix FT over-the-DS decryption 37c87efecfe3 wlantest: Search SPA using MLO aware find for FT Request/Response frame 19f33d7929e8 wlantest: Learn the Link ID for AP MLD affiliated BSSs 6ae43bb10323 wlantest: Learn link address for assoc link from (Re)Association Request 4c079dcc64da Increment hmac_sha*_vector() maximum num_elem value to 25 e6f64a8e1daf FT: FTE MIC calculation for MLO Reassociation Request frame a83575df5994 wlantest: FTE MIC calculation for MLO Reassociation Request frames ff02f734baf8 wlantest: Allow specific link BSS to be found with bss_find_mld() 7381c60db8f0 FT: Make FTE MIC calculation more flexible ac9bf1cc2a4c Decrement hmac_sha*_vector() maximum num_elem value to 11 aa08d9d76803 Fix use of defragmented FTE information 78b153f90a74 Calculate defragmented FTE length during IE parsing 8cf919ffd5c4 wlantest: FTE MIC calculation for MLO Reassociation Response frame d12a3dce82a9 wlantest: Store and check SNonce/ANonce for FT Authentication 20febfd7838d wlantest: Dump MLO association information in debug 609864d6a8a1 Add QCA vendor attribute to configure MLD ID in ML probe request 12154861e24a Add support for conversion to little endian for 24 bits c437665041c0 Add Non EHT SCS Capability in (Re)Association Request frames 33da386553b7 SCS: Add support for QoS Characteristics in SCS request edfca280cbe8 SCS: Add support for optional QoS Charateristics parameters 32dcec9529ec Send actual MFP configuration when driver takes care of BSS selection 123d16d860fa Update hw_mode when CSA finishes b3d852560bda Change QCA vendor configure attribution name of peer MAC address 12fabc4765c2 Add QCA vendor attribute for configuring max A-MPDU aggregation count f6eaa7b729cb Add QCA vendor attribute for TTLM negotiation support type f6dcd326fea7 wlantest: Indicate ToDS/FromDS values for BSS DATA entries 6ce745bb87d4 wlantest: MLO support for decrypting 4-address frames 850dc1482953 wlantest: Remove duplicated A1/A2/A3 override detection for MLO 770e5a808fbb wlantest: Determine whether A1 points to STA once in rx_data_bss_prot() 377d617b574a Define new BSS command info mask for AP MLD address d3ab6e001f62 wlantest: Use non-AP MLD's MLD MAC address in FT over-the-air derivation a845601ffe32 wlantest: Derive PTK in MLO using MLD MAC addresses for FT over-the-air 0cd2bfc8a402 wlantest: Fix FTE MIC calculation for MLO Reassociation Response frames 528abdeb673b wlantest: Learn group keys from MLO FT Reassociation Response frames 990600753dd9 wlantest: Defragment Basic MLE before processing de043ec01ab5 wlantest: Defragment the Per-STA Profile subelement bae1ec693c44 wlantest: Minimal parsing of Basic MLE STA Profile ba1579f3bf7c Clear BIGTK values from wpa_supplicant state machine when not needed b46c4b9a916a tests: Beacon protection and reconnection 3e71516936b7 Document per-ESS MAC address (mac_addr=3 and mac_value) f85b2b2dee3b Extend wpa_parse_kde_ies() to include EHT capabilities e3a68081bc1e driver: Add option for link ID to be specified for send_tdls_mgmt() c7561502f2e8 nl80211: Use a QCA vendor command to set the link for TDLS Discovery Response a41c8dbdd84e TDLS: Copy peer's EHT capabilities 626501434be1 TDLS: Learn MLD link ID from TDLS Discovery Response 5f30f62eead7 TDLS: Reply to Discovery Request on the link with matching BSSID 940ef9a05c0f TDLS: Use link-specific BSSID instead of sm->bssid for MLO cases f429064189c3 TDLS: Set EHT/MLO information for TDLS STA into the driver dd25885a9daa Remove space-before-tab in QCA vendor related definitions af6e0306b2a9 Fix typos in QCA vendor related definitions 4c9af238c1e4 Fix inconsistent whitespace use in QCA vendor related definitions e5ccbfc69ecf Split long comment lines in QCA vendor related definitions Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-13 09:00:53 +00:00
@@ -11908,85 +11906,66 @@ static int wpa_driver_br_add_ip_neigh(vo
}
if (version == 4) {
- family = AF_INET;
+ nhdr.ndm_family = AF_INET;
addrsize = 4;
} else if (version == 6) {
- family = AF_INET6;
+ nhdr.ndm_family = AF_INET6;
addrsize = 16;
} else {
return -EINVAL;
}
- rn = rtnl_neigh_alloc();
- if (rn == NULL)
+ msg = nlmsg_alloc_simple(RTM_NEWNEIGH, NLM_F_CREATE);
+ if (!msg)
return -ENOMEM;
- /* set the destination ip address for neigh */
- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
- if (nl_ipaddr == NULL) {
- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
- res = -ENOMEM;
+ res = -ENOMEM;
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
goto errout;
- }
- nl_addr_set_prefixlen(nl_ipaddr, prefixlen);
- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
- if (res) {
- wpa_printf(MSG_DEBUG,
- "nl80211: neigh set destination addr failed");
+
+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
goto errout;
- }
- /* set the corresponding lladdr for neigh */
- nl_lladdr = nl_addr_build(AF_BRIDGE, (u8 *) addr, ETH_ALEN);
- if (nl_lladdr == NULL) {
- wpa_printf(MSG_DEBUG, "nl80211: neigh set lladdr failed");
- res = -ENOMEM;
+ if (nla_put(msg, NDA_LLADDR, ETH_ALEN, (void *)addr))
goto errout;
- }
- rtnl_neigh_set_lladdr(rn, nl_lladdr);
- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
- rtnl_neigh_set_state(rn, NUD_PERMANENT);
+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
+ if (res < 0)
+ goto errout;
- res = rtnl_neigh_add(drv->rtnl_sk, rn, NLM_F_CREATE);
+ res = nl_wait_for_ack(drv->rtnl_sk);
if (res) {
wpa_printf(MSG_DEBUG,
"nl80211: Adding bridge ip neigh failed: %s",
nl_geterror(res));
}
errout:
- if (nl_lladdr)
- nl_addr_put(nl_lladdr);
- if (nl_ipaddr)
- nl_addr_put(nl_ipaddr);
- if (rn)
- rtnl_neigh_put(rn);
+ nlmsg_free(msg);
return res;
-#else /* CONFIG_LIBNL3_ROUTE */
- return -1;
-#endif /* CONFIG_LIBNL3_ROUTE */
}
static int wpa_driver_br_delete_ip_neigh(void *priv, u8 version,
const u8 *ipaddr)
{
-#ifdef CONFIG_LIBNL3_ROUTE
struct i802_bss *bss = priv;
struct wpa_driver_nl80211_data *drv = bss->drv;
- struct rtnl_neigh *rn;
- struct nl_addr *nl_ipaddr;
- int family, addrsize;
+ struct ndmsg nhdr = {
+ .ndm_state = NUD_PERMANENT,
+ .ndm_ifindex = bss->br_ifindex,
+ };
+ struct nl_msg *msg;
+ int addrsize;
int res;
if (!ipaddr)
return -EINVAL;
if (version == 4) {
- family = AF_INET;
+ nhdr.ndm_family = AF_INET;
addrsize = 4;
} else if (version == 6) {
- family = AF_INET6;
+ nhdr.ndm_family = AF_INET6;
addrsize = 16;
} else {
return -EINVAL;
hostapd: update to the latest version 8e6485a1bcb0 PEAP client: Update Phase 2 authentication requirements de9a11f4dde9 TTLS client: Support phase2_auth=2 b2a1e7fe7ab9 tests: PEAP and TTLS phase2_auth behavior 518ae8c7cca8 P2P: Do not print control characters in debug a4c133ea73c7 WPS: Optimize attribute parsing workaround 7a37a94eaa0d Check whether element parsing has failed f80d83368818 ACS: Remove invalid debug print fb2b7858a728 FILS: Fix HE MCS field initialization 50ee26fc7044 P2P: Check p2p_channel_select() return value a50d1ea6a2b3 Add QCA vendor attributes for user defined power save parameters 4636476b7f22 Set RRM used config if the (Re)Association Request frame has RRM IE e53d44ac63e8 AP MLD: Use STA assoc link address in external auth status to the driver 99a96b2f9df7 AP MLD: OWE when SME is offloaded to the driver 96deacf5d710 nl80211: Skip STA MLO link channel switch handling in AP mode d320692d918a AP MLD: Handle new STA event when using SME offload to the driver faee8b99e928 tests: Fix eht_mld_sae_legacy_client to restore sae_pwe c3f465c56c94 wlantest: Handle variable length MIC field in EAPOL-Key with OWE 605034240e0c wlantest: Support multiple input files 053bd8af8ed2 Recognize FTE MLO subelements 43b5f11d969a Defragmentation of FTE 3973300b8ded FTE protected element check for MLO Reassociation Response frame 74e4a0a6f1e4 wlantest: Learn AP MLD MAC address from Beacon frames a5a0b2cf7b1b wlantest: Find non-AP MLD only from affiliated BSSs of the AP MLD 74472758584d wlantest: Recognize non-AP MLD based on any link address for decryption 1ffabd697c67 wlantest: Learn non-AP MLD MAC address from (Re)Association Request frames 4e8e515f92b9 wlantest: Use MLO search for the STA in reassociation 49bf9f2df95a wlantest: Use the MLD MAC address as well for matching STA entries 5434a42ec69c wlantest: Search for FT Target AP using MLD MAC address as well a19fcf685cae wlantest: Include the MLD MAC address of the AP MLD in new-STA prints 709d46da73da wlantest: Do not claim update to AP MD MAC address if no change 770760454f9e wlantest: Do not update BSS entries for other AP MLDs in PTK cloning 084745ffc508 Add QCA vendor attributes for NDP setup bf9cbb462fd9 Fix writing of BIGTK in FT protocol 011775af9443 tests: Check for beacon loss when using beacon protection 8f148d51322f Fix a compiler warning on prototype mismatch b7db495ad9c9 AP: Fix ieee802_1x_ml_set_sta_authorized() 232667eafe0d Fix CCMP test vector issues 30771e6e05ed Include PTID in PV1 nonce construction for CCMP test vector 34841cfd9aba Minor formatting changes to CCMP test vectors a685d84139e6 BSS coloring: Fix CCA with multiple BSS bc0636841a70 wpa_supplicant: Fix configuration parsing error for tx_queue_* 2763d1d97e66 hostapd: Fix AID assignment in multiple BSSID 763a19286e2f AP: Add configuration option to specify the desired MLD address bd209633eb10 AP: Use is_zero_ether_addr() to check if BSSID is NULL bc0268d053b4 wlantest: Guess SAE/OWE group from EAPOL-Key length mismatch a94ba5322803 EHT: Support puncturing for 320 MHz channel bandwidth 7e1f5c44c97e EHT: 320 MHz DFS support 6f293b32112a QCA vendor attributes for updating roaming AP BSSID info 5856373554eb Extend QCA vendor command to include more parameters for netdev events e080930aa0a5 Define QCA vendor roam control RSSI attributes fe72afe713ad Define QCA vendor attribute for high RSSI roam trigger threshold 47a65ccbfde2 P2P: Clean wpa_s->last_ssid when removing a temporary group network 884125ab7d21 tests: P2P autonomous GO and clearing of networking information 7637d0f25053 P2P: Do not filter pref_freq_list if the driver does not provide one dd1330b502ff Fix hostapd interface cleanup with multiple interfaces 0a6842d5030e nl80211: Fix beacon rate configuration for legacy rates 36, 48, 54 Mbps d606efe054d5 tests: Beacon rate configuration for 54 Mbps f91d10c0e6aa tests: Update RSA 3k certificates 07d3c1177bbb tests: Make sae_proto_hostapd_status_* more robust 1085e3bdc6f6 Update iface->current_mode when fetching new hw_features 338a78846b44 Add a QCA vendor sub command for transmit latency statistics 9318db7c38bc wlantest: Use local variables for AA/SPA in FT Request/Response processing 628b9f10223d wlantest: Derive PMK-R1 and PTK using AA/SPA for MLO FT over-the-DS 104aa291e5c8 wlantest: Fix FT over-the-DS decryption 37c87efecfe3 wlantest: Search SPA using MLO aware find for FT Request/Response frame 19f33d7929e8 wlantest: Learn the Link ID for AP MLD affiliated BSSs 6ae43bb10323 wlantest: Learn link address for assoc link from (Re)Association Request 4c079dcc64da Increment hmac_sha*_vector() maximum num_elem value to 25 e6f64a8e1daf FT: FTE MIC calculation for MLO Reassociation Request frame a83575df5994 wlantest: FTE MIC calculation for MLO Reassociation Request frames ff02f734baf8 wlantest: Allow specific link BSS to be found with bss_find_mld() 7381c60db8f0 FT: Make FTE MIC calculation more flexible ac9bf1cc2a4c Decrement hmac_sha*_vector() maximum num_elem value to 11 aa08d9d76803 Fix use of defragmented FTE information 78b153f90a74 Calculate defragmented FTE length during IE parsing 8cf919ffd5c4 wlantest: FTE MIC calculation for MLO Reassociation Response frame d12a3dce82a9 wlantest: Store and check SNonce/ANonce for FT Authentication 20febfd7838d wlantest: Dump MLO association information in debug 609864d6a8a1 Add QCA vendor attribute to configure MLD ID in ML probe request 12154861e24a Add support for conversion to little endian for 24 bits c437665041c0 Add Non EHT SCS Capability in (Re)Association Request frames 33da386553b7 SCS: Add support for QoS Characteristics in SCS request edfca280cbe8 SCS: Add support for optional QoS Charateristics parameters 32dcec9529ec Send actual MFP configuration when driver takes care of BSS selection 123d16d860fa Update hw_mode when CSA finishes b3d852560bda Change QCA vendor configure attribution name of peer MAC address 12fabc4765c2 Add QCA vendor attribute for configuring max A-MPDU aggregation count f6eaa7b729cb Add QCA vendor attribute for TTLM negotiation support type f6dcd326fea7 wlantest: Indicate ToDS/FromDS values for BSS DATA entries 6ce745bb87d4 wlantest: MLO support for decrypting 4-address frames 850dc1482953 wlantest: Remove duplicated A1/A2/A3 override detection for MLO 770e5a808fbb wlantest: Determine whether A1 points to STA once in rx_data_bss_prot() 377d617b574a Define new BSS command info mask for AP MLD address d3ab6e001f62 wlantest: Use non-AP MLD's MLD MAC address in FT over-the-air derivation a845601ffe32 wlantest: Derive PTK in MLO using MLD MAC addresses for FT over-the-air 0cd2bfc8a402 wlantest: Fix FTE MIC calculation for MLO Reassociation Response frames 528abdeb673b wlantest: Learn group keys from MLO FT Reassociation Response frames 990600753dd9 wlantest: Defragment Basic MLE before processing de043ec01ab5 wlantest: Defragment the Per-STA Profile subelement bae1ec693c44 wlantest: Minimal parsing of Basic MLE STA Profile ba1579f3bf7c Clear BIGTK values from wpa_supplicant state machine when not needed b46c4b9a916a tests: Beacon protection and reconnection 3e71516936b7 Document per-ESS MAC address (mac_addr=3 and mac_value) f85b2b2dee3b Extend wpa_parse_kde_ies() to include EHT capabilities e3a68081bc1e driver: Add option for link ID to be specified for send_tdls_mgmt() c7561502f2e8 nl80211: Use a QCA vendor command to set the link for TDLS Discovery Response a41c8dbdd84e TDLS: Copy peer's EHT capabilities 626501434be1 TDLS: Learn MLD link ID from TDLS Discovery Response 5f30f62eead7 TDLS: Reply to Discovery Request on the link with matching BSSID 940ef9a05c0f TDLS: Use link-specific BSSID instead of sm->bssid for MLO cases f429064189c3 TDLS: Set EHT/MLO information for TDLS STA into the driver dd25885a9daa Remove space-before-tab in QCA vendor related definitions af6e0306b2a9 Fix typos in QCA vendor related definitions 4c9af238c1e4 Fix inconsistent whitespace use in QCA vendor related definitions e5ccbfc69ecf Split long comment lines in QCA vendor related definitions Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-13 09:00:53 +00:00
@@ -12004,41 +11983,30 @@ static int wpa_driver_br_delete_ip_neigh
return -1;
}
- rn = rtnl_neigh_alloc();
- if (rn == NULL)
+ msg = nlmsg_alloc_simple(RTM_DELNEIGH, NLM_F_CREATE);
+ if (!msg)
return -ENOMEM;
- /* set the destination ip address for neigh */
- nl_ipaddr = nl_addr_build(family, (void *) ipaddr, addrsize);
- if (nl_ipaddr == NULL) {
- wpa_printf(MSG_DEBUG, "nl80211: nl_ipaddr build failed");
- res = -ENOMEM;
+ res = -ENOMEM;
+ if (nlmsg_append(msg, &nhdr, sizeof(nhdr), NLMSG_ALIGNTO) < 0)
goto errout;
- }
- res = rtnl_neigh_set_dst(rn, nl_ipaddr);
- if (res) {
- wpa_printf(MSG_DEBUG,
- "nl80211: neigh set destination addr failed");
+
+ if (nla_put(msg, NDA_DST, addrsize, (void *)ipaddr))
goto errout;
- }
- rtnl_neigh_set_ifindex(rn, bss->br_ifindex);
+ res = nl_send_auto_complete(drv->rtnl_sk, msg);
+ if (res < 0)
+ goto errout;
- res = rtnl_neigh_delete(drv->rtnl_sk, rn, 0);
+ res = nl_wait_for_ack(drv->rtnl_sk);
if (res) {
wpa_printf(MSG_DEBUG,
"nl80211: Deleting bridge ip neigh failed: %s",
nl_geterror(res));
}
errout:
- if (nl_ipaddr)
- nl_addr_put(nl_ipaddr);
- if (rn)
- rtnl_neigh_put(rn);
+ nlmsg_free(msg);
return res;
-#else /* CONFIG_LIBNL3_ROUTE */
- return -1;
-#endif /* CONFIG_LIBNL3_ROUTE */
}