[PATCH 1/2] supplicant: Use high-priority queue for management packets.

greearb at candelatech.com greearb at candelatech.com
Mon Sep 9 14:49:04 EDT 2013


From: Ben Greear <greearb at candelatech.com>

Without this patch, wpa_supplicant EAPOL packets (at least)
are sent on normal best-effort TX queue.  I believe they
should be on the VO high-priority queue instead.

Signed-hostap: Ben Greear <greearb at candelatech.com>
Signed-off-by: Ben Greear <greearb at candelatech.com>
---
:100644 100644 1419830... cf2a7cc... M	src/l2_packet/l2_packet_linux.c
 src/l2_packet/l2_packet_linux.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/l2_packet/l2_packet_linux.c b/src/l2_packet/l2_packet_linux.c
index 1419830..cf2a7cc 100644
--- a/src/l2_packet/l2_packet_linux.c
+++ b/src/l2_packet/l2_packet_linux.c
@@ -97,6 +97,7 @@ struct l2_packet_data * l2_packet_init(
 	struct l2_packet_data *l2;
 	struct ifreq ifr;
 	struct sockaddr_ll ll;
+	int val = (256 + 7);
 
 	l2 = os_zalloc(sizeof(struct l2_packet_data));
 	if (l2 == NULL)
@@ -146,6 +147,18 @@ struct l2_packet_data * l2_packet_init(
 	}
 	os_memcpy(l2->own_addr, ifr.ifr_hwaddr.sa_data, ETH_ALEN);
 
+	
+	/* Use high-priority queue for management packets
+	 * http://wireless.kernel.org/en/developers/Documentation/mac80211/queues
+	 */
+	if (setsockopt(l2->fd, SOL_SOCKET,
+		       SO_PRIORITY, (char*)&val, sizeof(val)) < 0) {
+		/* Carry on...this is not fatal. */
+		wpa_printf(MSG_DEBUG,
+			   "l2_packet: sock priority sockopt (%i) failed\n",
+			   val);
+	}
+
 	eloop_register_read_sock(l2->fd, l2_packet_receive, l2, NULL);
 
 	return l2;
-- 
1.7.3.4



More information about the HostAP mailing list