From nobody Tue Sep 12 05:53:15 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 4RlCRw1Ty4z4sYGw; Tue, 12 Sep 2023 05:53:16 +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 4RlCRw04dsz3djb; Tue, 12 Sep 2023 05:53:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694497996; 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=dz8Uon6WpMPlZFxiPad9M7XjRwbljPBcto46CZjINeE=; b=iGeInzl3Z6XBH3217+s1uwhyMrRZHnAi43VxTi3uTqDdikCTDx5yzTNWsUAFKxOeicdvL2 g/JYFlkH+Sawl8TgUUNhxnozqSPuJLx3sWYEVjMYgoDEHAQ/8Mr33pSMxApfP3T3KmER/6 z5c3M5xpfs1wEjce/ReET/7NCZVyP0UTOkx95W7UuErZrUrR99IijXPzt/sH2uRA4JEnZu S6gSpjHsWipib9/iDsRP23mmpwthJ5aCS0NaVidnG4h4iDY3pkrZbpqmEv1xrTRqnuwMym QHVZ0kg51Uv1I8pD1umtYW5x3GRWSwtsvAi/MAq13PG0xOnn0SqOev3pWWs+Rg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694497996; a=rsa-sha256; cv=none; b=mWPP7wYUvSDs3Y2cb2xG/l3B0/C58NPtV5XkJijEbrqSwhqc9T8jFlLu6LHYLzrYGQfIuo A+rgdfwKD4kjHgwRj13/xRTYHZtJLEVrvNnzUozKmdm44gRuJ+M/ZQaJTTrLZthiQyUxSQ VEowUEV6zUAmfyKhrmfmkH2d/WUBlhXd+pArWq/T3X4ndBD8bvzabNKIRS4NLrlRBb5mjA hVKQp4bIcAPq3306Mlbf02rZzcg8AzA9+MR0q7CWThoi359S2kv70Hn30ssIpZnP0D+Key t4vZmDWBk7b2UuYpEQjH7Dbz3JAEh+5KAs7qcgtHVjwdV2xT6g8vCvoAg7/q9Q== 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=1694497996; 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=dz8Uon6WpMPlZFxiPad9M7XjRwbljPBcto46CZjINeE=; b=wFG547m8VIXNWIDlAR0eFI7if8XCpJr84qQwHSnms6nW2KSOo2v356ZFX8fsc3TGHKbx5n ycw+WyyLeV8TL8415b5+8idpG1L6x7bAX+FpfeiWLGhHqGeMXddEafF/FSq+KJEPkckONt UOfMxF7fqiohUoZXxDmVzgURry0DQct22+n098XVer2WTKE9yRGuiBuTKsPlL8FuTL5em/ lKYoqdslRGbpW+JKs1hyeb+Dr7uGUmQCdeZVby3YAql+6OaGYwOIG3QBoX1Yh+nOpWbd5a FfVEz6oh+0JfrlQpKwhw8RMUvSflEVCr+34hD8A21V3zH5n7Jl+zenrKzXLpqA== 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 4RlCRv5lGrz4tS; Tue, 12 Sep 2023 05:53:15 +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 38C5rFBM087096; Tue, 12 Sep 2023 05:53:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38C5rFdO087093; Tue, 12 Sep 2023 05:53:15 GMT (envelope-from git) Date: Tue, 12 Sep 2023 05:53:15 GMT Message-Id: <202309120553.38C5rFdO087093@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: 92b2d8e1bf08 - main - net/hostapd-devel: 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: 92b2d8e1bf08f4b81a5b3b92b30149dfd0807538 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=92b2d8e1bf08f4b81a5b3b92b30149dfd0807538 commit 92b2d8e1bf08f4b81a5b3b92b30149dfd0807538 Author: R. Christian McDonald AuthorDate: 2023-09-12 05:26:24 +0000 Commit: Cy Schubert CommitDate: 2023-09-12 05:51:32 +0000 net/hostapd-devel: 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-devel/Makefile | 2 +- .../patch-src_l2__packet_l2__packet__freebsd.c | 30 ++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/net/hostapd-devel/Makefile b/net/hostapd-devel/Makefile index 06df1ba11977..d05bb9153e71 100644 --- a/net/hostapd-devel/Makefile +++ b/net/hostapd-devel/Makefile @@ -1,6 +1,6 @@ PORTNAME= hostapd PORTVERSION= ${COMMIT_DATE} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= net PKGNAMESUFFIX= -devel diff --git a/net/hostapd-devel/files/patch-src_l2__packet_l2__packet__freebsd.c b/net/hostapd-devel/files/patch-src_l2__packet_l2__packet__freebsd.c index 224ca67ee95f..5cef27d8a415 100644 --- a/net/hostapd-devel/files/patch-src_l2__packet_l2__packet__freebsd.c +++ b/net/hostapd-devel/files/patch-src_l2__packet_l2__packet__freebsd.c @@ -1,5 +1,5 @@ --- src/l2_packet/l2_packet_freebsd.c.orig 2023-09-05 10:38:47.000000000 -0700 -+++ src/l2_packet/l2_packet_freebsd.c 2023-09-11 22:12:22.076149000 -0700 ++++ src/l2_packet/l2_packet_freebsd.c 2023-09-11 22:21:57.799201000 -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;