diff mbox series

[7/7] netdev: Remove vendor_ies from netdev_connect signature

Message ID 20231201040020.161143-7-denkenz@gmail.com (mailing list archive)
State New
Headers show
Series [1/7] handshake: Add cleanup function for handshake_state | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

Denis Kenzior Dec. 1, 2023, 4 a.m. UTC
The vendor IEs are now passed in the handshake_state object instead.
---
 src/netdev.c  | 27 ++++++---------------------
 src/netdev.h  |  2 --
 src/p2p.c     |  2 +-
 src/station.c |  2 +-
 src/wsc.c     |  2 +-
 5 files changed, 9 insertions(+), 26 deletions(-)
diff mbox series

Patch

diff --git a/src/netdev.c b/src/netdev.c
index eb408447224c..f2e887b4d70b 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -2450,9 +2450,7 @@  static void netdev_driver_connected(struct netdev *netdev)
 
 static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev,
 						struct handshake_state *hs,
-						const uint8_t *prev_bssid,
-						const struct iovec *vendor_ies,
-						size_t num_vendor_ies)
+						const uint8_t *prev_bssid)
 {
 	struct netdev_handshake_state *nhs =
 		l_container_of(hs, struct netdev_handshake_state, super);
@@ -2529,12 +2527,6 @@  static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev,
 
 	mpdu_sort_ies(subtype, iov, c_iov);
 
-	if (vendor_ies && !L_WARN_ON(n_iov - c_iov < num_vendor_ies)) {
-		memcpy(iov + c_iov, vendor_ies,
-					sizeof(*vendor_ies) * num_vendor_ies);
-		c_iov += num_vendor_ies;
-	}
-
 	if (c_iov)
 		l_genl_msg_append_attrv(msg, NL80211_ATTR_IE, iov, c_iov);
 
@@ -2570,8 +2562,7 @@  static bool netdev_retry_owe(struct netdev *netdev)
 	if (!owe_next_group(netdev->owe_sm))
 		return false;
 
-	connect_cmd = netdev_build_cmd_connect(netdev,
-					netdev->handshake, NULL, NULL, 0);
+	connect_cmd = netdev_build_cmd_connect(netdev, netdev->handshake, NULL);
 
 	netdev->connect_cmd_id = l_genl_family_send(nl80211, connect_cmd,
 						netdev_cmd_connect_cb, netdev,
@@ -3807,8 +3798,6 @@  static void netdev_connect_common(struct netdev *netdev,
 					const struct scan_bss *bss,
 					const struct scan_bss *prev_bss,
 					struct handshake_state *hs,
-					const struct iovec *vendor_ies,
-					size_t num_vendor_ies,
 					netdev_event_func_t event_filter,
 					netdev_connect_cb_t cb, void *user_data)
 {
@@ -3866,8 +3855,7 @@  static void netdev_connect_common(struct netdev *netdev,
 		break;
 	default:
 build_cmd_connect:
-		cmd_connect = netdev_build_cmd_connect(netdev, hs, prev_bssid,
-						vendor_ies, num_vendor_ies);
+		cmd_connect = netdev_build_cmd_connect(netdev, hs, prev_bssid);
 
 		if (!is_offload(hs) && (is_rsn || hs->settings_8021x)) {
 			sm = eapol_sm_new(hs);
@@ -3900,8 +3888,6 @@  build_cmd_connect:
 
 int netdev_connect(struct netdev *netdev, const struct scan_bss *bss,
 				struct handshake_state *hs,
-				const struct iovec *vendor_ies,
-				size_t num_vendor_ies,
 				netdev_event_func_t event_filter,
 				netdev_connect_cb_t cb, void *user_data)
 {
@@ -3918,9 +3904,8 @@  int netdev_connect(struct netdev *netdev, const struct scan_bss *bss,
 	if (netdev_handshake_state_setup_connection_type(hs) < 0)
 		return -ENOTSUP;
 
-	netdev_connect_common(netdev, bss, NULL, hs, vendor_ies,
-					num_vendor_ies, event_filter, cb,
-					user_data);
+	netdev_connect_common(netdev, bss, NULL, hs,
+				event_filter, cb, user_data);
 
 	return 0;
 }
@@ -4025,7 +4010,7 @@  int netdev_reassociate(struct netdev *netdev, const struct scan_bss *target_bss,
 	netdev->connected = false;
 	netdev->in_reassoc = true;
 
-	netdev_connect_common(netdev, target_bss, orig_bss, hs, NULL, 0,
+	netdev_connect_common(netdev, target_bss, orig_bss, hs,
 					event_filter, cb, user_data);
 
 	if (netdev->ap)
diff --git a/src/netdev.h b/src/netdev.h
index f27130f14e56..03d1b6e94dd4 100644
--- a/src/netdev.h
+++ b/src/netdev.h
@@ -155,8 +155,6 @@  struct handshake_state *netdev_get_handshake(struct netdev *netdev);
 
 int netdev_connect(struct netdev *netdev, const struct scan_bss *bss,
 				struct handshake_state *hs,
-				const struct iovec *vendor_ies,
-				size_t num_vendor_ies,
 				netdev_event_func_t event_filter,
 				netdev_connect_cb_t cb, void *user_data);
 int netdev_disconnect(struct netdev *netdev,
diff --git a/src/p2p.c b/src/p2p.c
index e2d752776cb8..08fe8444fbb9 100644
--- a/src/p2p.c
+++ b/src/p2p.c
@@ -1555,7 +1555,7 @@  static void p2p_try_connect_group(struct p2p_device *dev)
 	if (dev->conn_peer_capability.group_caps & P2P_GROUP_CAP_IP_ALLOCATION)
 		hs->support_ip_allocation = true;
 
-	r = netdev_connect(dev->conn_netdev, bss, hs, NULL, 0,
+	r = netdev_connect(dev->conn_netdev, bss, hs,
 				p2p_netdev_event, p2p_netdev_connect_cb, dev);
 	if (r < 0) {
 		l_error("netdev_connect error: %s (%i)", strerror(-r), -r);
diff --git a/src/station.c b/src/station.c
index 49cad135eaf0..48a595dcd340 100644
--- a/src/station.c
+++ b/src/station.c
@@ -3453,7 +3453,7 @@  int __station_connect_network(struct station *station, struct network *network,
 	if (!hs)
 		return -ENOTSUP;
 
-	r = netdev_connect(station->netdev, bss, hs, NULL, 0,
+	r = netdev_connect(station->netdev, bss, hs,
 				station_netdev_event,
 				station_connect_cb, station);
 	if (r < 0) {
diff --git a/src/wsc.c b/src/wsc.c
index b063313ac6dc..cda877cf7e6d 100644
--- a/src/wsc.c
+++ b/src/wsc.c
@@ -384,7 +384,7 @@  static int wsc_enrollee_connect(struct wsc_enrollee *wsce, struct scan_bss *bss,
 
 	handshake_state_set_vendor_ies(hs, ie_iov, 1 + ies_num);
 
-	r = netdev_connect(wsce->netdev, bss, hs, NULL, 0,
+	r = netdev_connect(wsce->netdev, bss, hs,
 				wsc_enrollee_netdev_event,
 				wsc_enrollee_connect_cb, wsce);
 	l_free(ie_iov[0].iov_base);