From nobody Tue Sep 12 05:53:11 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 4RlCRq3dnGz4sYXD; Tue, 12 Sep 2023 05:53:11 +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 4RlCRq2srHz3dNr; Tue, 12 Sep 2023 05:53:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694497991; 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=xGDh3UN0srZiG9GOgV+UdsuPvSwSSpxzI78i6YSf0FE=; b=XkFWAUwhJgdSy9eOMaxgHMruTn8MSNaLFp6EaUB/gNVwU2iwpgzJaVBruNhmWberuGe1Vk 8x21tduFXfrihLpB4Z4KKjYKQNL1NtxgEVEO3Jup6sf7QMkTXP9hriQnn/e0xRu3l/2pjh DQmCzUJwzjACUcMPZ1xrsK2FghFo1Ef9JD1lGxwEjMu17gq3MpGESiMYgKJnmmXla98Qa8 PPAkIDoH0FdWR8niNVchB94rYvyZlquDmOdD43goEeX/b2OzDu3YV5ALi8+wzCkmEursz4 zv93cCsKXSAG/pSFCvocKJqdUBFQ7OwXVegkjRkBELzg1tWWhiJyNcKnq0Pdsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694497991; a=rsa-sha256; cv=none; b=MyO9dWoC1h4lwMotbYX6Kuap6dqsRuLo1W27//QaOAjfGXpH1hBzPU4yd0Jiwgq9u1oBdQ mTvXZUBTaumMq1Th/CiHdyPUrZ3ZAYj5BSFOzOXYmUMKod5ruB7xMhua9w4fkKsxoR1+7/ PPv+Shp+MTFGfuaK/1sZZI7L5yaJLqEuI27MBg7pFEpbm1ahZhiUKxwoeod/uWagjxu0rW LUWJ0G+LsL1OpVrxaVyG6p5y/rp5FyEsFScWZSjLqqvgv6WTOsxUQY/g1rHZiV/7Db/miX rXq0jS9T8ohS9jiHjfoUOwM62aZhAd8kzizBZ1b4jcu2d/flTiFAC8OYb8BKqw== 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=1694497991; 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=xGDh3UN0srZiG9GOgV+UdsuPvSwSSpxzI78i6YSf0FE=; b=ZOl92X4Kn3w1C9Lbw5JZb+lIG0p7pEEgc5pVhaN/JTaiFp3iJsmsx2OOwttAMqDX9CbImn fmeN/gyLeLYAtgLGfJrXWJOBxupKyH2uT69tJY4IUp31E5uyuwiHfgytxQK4JkmzNI1Riq LNaY+h+aqBCzp8SzP3gI/A/r7pF7iolXefjA3QatxcJkycfly8QVL9rg2IWZTlZHrbY6nc LK/ZCnEye6ED0Ius9j+Ze2UmV2J4kIdApqJSUtFcwJf5q0dbcC2nbQQYsisHrh0gIvwJ6R WHtyWpdTTk6GtAu0cIDaEgLk0EV81DXp76qbE/Vabmusa0VL6HAk/lR3sSFTeA== 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 4RlCRq1yRmz5dn; Tue, 12 Sep 2023 05:53:11 +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 38C5rBgv086868; Tue, 12 Sep 2023 05:53:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38C5rBVV086865; Tue, 12 Sep 2023 05:53:11 GMT (envelope-from git) Date: Tue, 12 Sep 2023 05:53:11 GMT Message-Id: <202309120553.38C5rBVV086865@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: 2150c312db2f - main - net/hostapd-devel: Fix uninitialized packet pointer on error 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: 2150c312db2fe116e2ce5024645163948334d1e7 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/ports/commit/?id=2150c312db2fe116e2ce5024645163948334d1e7 commit 2150c312db2fe116e2ce5024645163948334d1e7 Author: Cy Schubert AuthorDate: 2023-09-12 05:17:36 +0000 Commit: Cy Schubert CommitDate: 2023-09-12 05:51:19 +0000 net/hostapd-devel: Fix uninitialized packet pointer on error The packet pointer (called packet) will remain uninitialized when pcap_next_ex() returns an error. This occurs when the wlan interface is shut down using ifconfig destroy. Adding a NULL assignment to packet duplicates what pcap_next() does. The reason we use pcap_next_ex() in this instance is because with pacp_next() when we receive a null pointer if there was an error or if no packets were read. With pcap_next_ex() we can differentiate between an error and legitimately no packets were received. PR: 270649, 273696 Obtained from: src 953efa5b200f Reported by: Robert Morris MFH: 2023Q3 --- net/hostapd-devel/Makefile | 2 +- net/hostapd-devel/files/patch-src_l2__packet_l2__packet__freebsd.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/net/hostapd-devel/Makefile b/net/hostapd-devel/Makefile index 5e4a2bf8feea..06df1ba11977 100644 --- a/net/hostapd-devel/Makefile +++ b/net/hostapd-devel/Makefile @@ -1,6 +1,6 @@ PORTNAME= hostapd PORTVERSION= ${COMMIT_DATE} -PORTREVISION= 1 +PORTREVISION= 2 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 26ecb22c808c..224ca67ee95f 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 2022-03-14 01:42:11.000000000 -0700 -+++ src/l2_packet/l2_packet_freebsd.c 2022-04-14 07:36:24.999713000 -0700 +--- 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 @@ -8,7 +8,10 @@ */ @@ -12,7 +12,7 @@ #include #endif /* __APPLE__ */ #include -@@ -76,24 +79,27 @@ +@@ -76,24 +79,28 @@ { struct l2_packet_data *l2 = eloop_ctx; pcap_t *pcap = sock_ctx; @@ -26,6 +26,7 @@ - packet = pcap_next(pcap, &hdr); + if (pcap_next_ex(pcap, &hdr, &packet) == -1) { + wpa_printf(MSG_ERROR, "Error reading packet, has device disappeared?"); ++ packet = NULL; + eloop_terminate(); + }