From nobody Tue Sep 12 05:53:14 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RlCRv5cbWz4sYXS; Tue, 12 Sep 2023 05:53:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RlCRt61Fjz3dg2; Tue, 12 Sep 2023 05:53:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694497994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mWGhgGJluyi0DbcG49It7tz9ej/6ZnXW8H31RSpVtO8=; b=FKd4SUuRT7VvyMRhhQgkAMuyw6XTZojmaRhDh2MEsp2eYrYrOuchQ6/HLwrT5W+eQpg/F6 cqMKdbdSxi6ykhQYSicMTOF0n5IxkebUnuhgaTLeG/79yZH7epZsHWTLPpBH80L1vsfatL 7FGAYP6oT8SwXzeM4F6urM6GKHSJDGa7rDwh1XW2sSD/ShqnU1B6ILhZevkHxNM7ZLR3er pUQBHZK1OqvtRlr7mFeusE3QjSgU6Vb1JunutHSHtT8xRB/otjIz0z/8oyUT3qR82LW/q5 hdoPK9+c8/cbh/wWXhobKhInVeQFOyXmJ/e6/0AaSIRTad+bW7haHHdmS0wDNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694497994; a=rsa-sha256; cv=none; b=PFdpT2GDFVRZspfKMkHYPqCdAby+4mGuQaQSaadlJiw2fdB+Lnd+vVZ3DUgz7uG8n+ynIu P7UH7CjJDFUeRFEDB1kjLpJh0ZxCVQM5CWXX+xWCSmu+bTSoWUMeNdOVBp42TULCe8M+cs AShROXSktJxbaseLaoElcI0L5XfsicH0T8QYb1UAL2DqAushX+4xTLWJikUGZGoXUsLQak d9o+J2tXY/pePNdfigIOjF2QoR994Snot0VLQG19ZIotKbxnrEFeyyANJsyKwsKr1b8C1c bwnBoKAikqkbMaLjAZ6WAcqQkzibt8lMijzRhyZhWsdBCqOQW21rBNq/jWY+2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694497994; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mWGhgGJluyi0DbcG49It7tz9ej/6ZnXW8H31RSpVtO8=; b=hoW/of8dOiXeLvjI4GUXYC0d1R85SB31/URS7k5+ZE2tpJdI6clnBdRE2tOmKJNyG5nccK 9/y3Iyu/Sbc1+F2vbagwS5PcC4jh1kAivsr5IfCR59La+nJ/7X21nPjl7tNKKrVVJmyDNj /mEiqUI1kNfg+j3nRFRfX2CYMx7j7u0l1+uWqlRQ1+VMUHDG0Cr2fg82j1uVB4gkaQW57Y rE8t4O/JDpgRKrmEh5QDjgrUIihfzw8DmhvKXDnVU7IxhIDV3Ww+9rCiTd//D/U52urRU6 zFpyDDHSRgg4s86U62qmomm6d9wnfL3/WwSQe2oYM//8zUTgqzPxzR4XrgcCpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RlCRt526rz4tQ; Tue, 12 Sep 2023 05:53:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38C5rEgX087036; Tue, 12 Sep 2023 05:53:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38C5rEnF087033; Tue, 12 Sep 2023 05:53:14 GMT (envelope-from git) Date: Tue, 12 Sep 2023 05:53:14 GMT Message-Id: <202309120553.38C5rEnF087033@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Cy Schubert Subject: git: 33410dc2fce3 - main - net/hostapd: wpa: Enable receiving priority tagged (VID 0) frames List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33410dc2fce35423090de7566b10b2ce4ba5795c Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=33410dc2fce35423090de7566b10b2ce4ba5795c commit 33410dc2fce35423090de7566b10b2ce4ba5795c Author: R. Christian McDonald AuthorDate: 2023-09-12 05:26:08 +0000 Commit: Cy Schubert CommitDate: 2023-09-12 05:51:29 +0000 net/hostapd: wpa: Enable receiving priority tagged (VID 0) frames Certain internet service providers transmit vlan 0 priority tagged EAPOL frames from the ONT towards the residential gateway. VID 0 should be ignored, and the frame processed according to the priority set in the 802.1P bits and the encapsulated EtherType (i.e. EAPOL). The pcap filter utilized by l2_packet is inadquate for this use case. Here we modify the pcap filter to accept both unencapsulated and encapsulated (with VLAN 0) EAPOL EtherTypes. This preserves the original filter behavior while also matching on encapsulated EAPOL. Sponsored by: Rubicon Communications, LLC ("Netgate") Reviewed by: cy Obtained from: src bb5d6d14d81b PR: 273696 MFH: 2023Q3 --- net/hostapd/Makefile | 2 +- .../patch-src_l2__packet_l2__packet__freebsd.c | 30 ++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/net/hostapd/Makefile b/net/hostapd/Makefile index 1e6d5841681a..e4951adea292 100644 --- a/net/hostapd/Makefile +++ b/net/hostapd/Makefile @@ -1,6 +1,6 @@ PORTNAME= hostapd PORTVERSION= 2.10 -PORTREVISION= 7 +PORTREVISION= 8 CATEGORIES= net MASTER_SITES= https://w1.fi/releases/ diff --git a/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c b/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c index 9d290e5dff5c..e0aa170fa91f 100644 --- a/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c +++ b/net/hostapd/files/patch-src_l2__packet_l2__packet__freebsd.c @@ -1,5 +1,5 @@ --- src/l2_packet/l2_packet_freebsd.c.orig 2022-01-16 12:51:29.000000000 -0800 -+++ src/l2_packet/l2_packet_freebsd.c 2023-09-11 22:00:09.826831000 -0700 ++++ src/l2_packet/l2_packet_freebsd.c 2023-09-11 22:21:12.054042000 -0700 @@ -8,7 +8,10 @@ */ @@ -12,7 +12,15 @@ #include #endif /* __APPLE__ */ #include -@@ -76,24 +79,28 @@ +@@ -20,6 +23,7 @@ + #include + #endif /* __sun__ */ + ++#include + #include + #include + #include +@@ -76,24 +80,33 @@ { struct l2_packet_data *l2 = eloop_ctx; pcap_t *pcap = sock_ctx; @@ -43,6 +51,24 @@ buf = (unsigned char *) (ethhdr + 1); - len = hdr.caplen - sizeof(*ethhdr); + len = hdr->caplen - sizeof(*ethhdr); ++ /* handle 8021Q encapsulated frames */ ++ if (ethhdr->h_proto == htons(ETH_P_8021Q)) { ++ buf += ETHER_VLAN_ENCAP_LEN; ++ len -= ETHER_VLAN_ENCAP_LEN; ++ } } l2->rx_callback(l2->rx_callback_ctx, ethhdr->h_source, buf, len); } +@@ -122,10 +135,10 @@ + os_snprintf(pcap_filter, sizeof(pcap_filter), + "not ether src " MACSTR " and " + "( ether dst " MACSTR " or ether dst " MACSTR " ) and " +- "ether proto 0x%x", ++ "( ether proto 0x%x or ( vlan 0 and ether proto 0x%x ) )", + MAC2STR(l2->own_addr), /* do not receive own packets */ + MAC2STR(l2->own_addr), MAC2STR(pae_group_addr), +- protocol); ++ protocol, protocol); + if (pcap_compile(l2->pcap, &pcap_fp, pcap_filter, 1, pcap_netp) < 0) { + fprintf(stderr, "pcap_compile: %s\n", pcap_geterr(l2->pcap)); + return -1;