From nobody Tue Sep 19 06:55:55 2023 X-Original-To: dev-commits-ports-main@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 4RqXVz587mz4tVmP; Tue, 19 Sep 2023 06:55:55 +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 4RqXVz4bS1z3CgK; Tue, 19 Sep 2023 06:55:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695106555; 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=Gvo8PVh5ZhB2jMyL8Fi7unO/eezdqEA2FY1juwHxBo0=; b=UX99SxB8cv74/BPTDIWIRD+BsLKLItpnfxx9JRvE/i8zpWcvZ/YtYr9YSm02oS8MVXeMSR 70RxAeIC7sMUkjzDuVVsQ4diCCjS3sFxMKcbYvgzoF+L3f5fyXQUHJFfBLOrBjKt1seoiO JMJvuIMhYnj02BIghG29+TSHINEIY9l5ZGI5g7f+ky7YZSEcHcpHHuLZ/o+BF4qBqo2N1j vDM/K0bZ4CYdotsIKos5G2/16hiHQlhoDh8yBG4oDzZl0O0wXKfllyWaI9QDwjKusca+SI cLU74p7T829K4De0wm+MjN0rQDgw1SW2m54aCoW5t4zECeLROmpeiCWk0sXq6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695106555; a=rsa-sha256; cv=none; b=wHpvaEsUpYcmKkXJ/3pOY/Avexpx+InMaHJA+3cxcEfQZ59NGLJhP5zDV9OhC/QUzehSMR QJuL1eH9MvRfFlMCVHb/qfU9A3io8NUnI92xDrfGaow6uNz1RUiM9uB2Qny2IDNMlbLHur JOHXrMks37bjMCvA2Gt5Wf3MIXOhKafdP0JmfME0LBnzq/96a8bB5QRP0ux0Nb55T8tudM qVeqHzNtjXak5Bjhrl5cvDNJf3tLipOmzmeQ3JtJt8/CGtyjqSGxYFk8dUunRI53VovwuS 9CMWbt+lq+l+il9u43V4v+8pNdpd/g+Cf3H3oP3DnqH7qVNE6YS9gsCrZn5gIA== 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=1695106555; 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=Gvo8PVh5ZhB2jMyL8Fi7unO/eezdqEA2FY1juwHxBo0=; b=i+L2sc1Y4t7Ko1MBSHPDxUhpRWBSkDUrx2XQFBuVh6ZGnTzVfB7tKpV3GYpfi0UNOYWTRs YSTIKHSbX846aT5XmuFInsZTxviFSOXwojf6tk2ydwhOEd88yWFai8orTjjRbEls+RCsYp /Z2LR8x3jXXKltcGufEXXMgFR8e6FPxJ5Xk1WFxWnxKskwbTjmn4yYut87QWVCkCSetysc Vg3EFaQ4D/JqgVZm0HBURQe/kn5QVdzEnjprG+ikxK8+lmGt9LUB3RycXTTP9+jCpGJJax 2t+M483LC3iO8zAI1RCoY8YW6HHQ4ohfcoZ8ZyL/nkLUUEO8AA+Zsk/YSdNCMg== 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 4RqXVz3cTPz13Cm; Tue, 19 Sep 2023 06:55:55 +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 38J6tt83043257; Tue, 19 Sep 2023 06:55:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38J6ttp1043254; Tue, 19 Sep 2023 06:55:55 GMT (envelope-from git) Date: Tue, 19 Sep 2023 06:55:55 GMT Message-Id: <202309190655.38J6ttp1043254@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Muhammad Moinur Rahman Subject: git: a36ac4ec4f06 - main - net/libdnet: Use libpfctl List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bofh X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a36ac4ec4f06a1d6a14f63972aaa1399035f55a6 Auto-Submitted: auto-generated The branch main has been updated by bofh: URL: https://cgit.FreeBSD.org/ports/commit/?id=a36ac4ec4f06a1d6a14f63972aaa1399035f55a6 commit a36ac4ec4f06a1d6a14f63972aaa1399035f55a6 Author: Kristof Provost AuthorDate: 2023-09-18 06:18:57 +0000 Commit: Muhammad Moinur Rahman CommitDate: 2023-09-19 06:24:59 +0000 net/libdnet: Use libpfctl Several old ioctl commands have been removed in 15/main, which broke compilation for this port. Rely on libpfctl instead. There are some breaking pf API changes in 14 which involves regarding the ioctl syscalls. This port is an old outdated port which explicitly used those older syscalls. This port also is dependency of net/scapy which is run in our CI for testing. So fix it with blanket approval. For more information see: https://lists.freebsd.org/archives/freebsd-pf/2023-April/000345.html PR: 273899 Approved by: portmgr (just-fix-it) Sponsored by: Rubicon Communications, LLC ("Netgate") --- net/libdnet/Makefile | 8 +++- net/libdnet/files/patch-src_fw-pf.c | 83 +++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 2 deletions(-) diff --git a/net/libdnet/Makefile b/net/libdnet/Makefile index 63134d9f8b40..2004f32597ea 100644 --- a/net/libdnet/Makefile +++ b/net/libdnet/Makefile @@ -1,7 +1,7 @@ PORTNAME= libdnet PORTVERSION= 1.13 DISTVERSIONPREFIX= v -PORTREVISION?= 3 +PORTREVISION?= 4 CATEGORIES?= net MAINTAINER?= onatan@gmail.com @@ -11,7 +11,11 @@ WWW= https://github.com/5u623l20/libdnet/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE -USES?= autoreconf libtool +LIB_DEPENDS= libpfctl.so:net/libpfctl + +USES?= autoreconf libtool localbase + +LDFLAGS+= -lpfctl USE_GITHUB= yes GH_ACCOUNT= 5u623l20 diff --git a/net/libdnet/files/patch-src_fw-pf.c b/net/libdnet/files/patch-src_fw-pf.c new file mode 100644 index 000000000000..4e892f271f15 --- /dev/null +++ b/net/libdnet/files/patch-src_fw-pf.c @@ -0,0 +1,83 @@ +--- src/fw-pf.c.orig 2019-03-19 17:55:02 UTC ++++ src/fw-pf.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -115,7 +116,7 @@ static int + } + + static int +-pr_to_fr(const struct pf_rule *pr, struct fw_rule *fr) ++pr_to_fr(const struct pfctl_rule *pr, struct fw_rule *fr) + { + memset(fr, 0, sizeof(*fr)); + +@@ -205,12 +206,14 @@ fw_add(fw_t *fw, const struct fw_rule *rule) + #ifdef HAVE_PF_CHANGE_GET_TICKET + { + struct fw_rule fr; ++ struct pfctl_rule pfrule; + + if (ioctl(fw->fd, DIOCGETRULES, &pcr) < 0) + return (-1); + while ((int)--pcr.nr >= 0) { +- if (ioctl(fw->fd, DIOCGETRULE, &pcr) == 0 && +- pr_to_fr(&pcr.rule, &fr) == 0) { ++ if (pfctl_get_rule(fw->fd, pcr.nr, pcr.ticket, pcr.anchor, ++ pcr.action, &pfrule, pcr.anchor_call) == 0 && ++ pr_to_fr(&pfrule, &fr) == 0) { + if (_fw_cmp(rule, &fr) == 0) { + errno = EEXIST; + return (-1); +@@ -244,13 +247,15 @@ fw_delete(fw_t *fw, const struct fw_rule *rule) + #ifdef HAVE_PF_CHANGE_GET_TICKET + { + struct fw_rule fr; ++ struct pfctl_rule pfrule; + int found = 0; + + if (ioctl(fw->fd, DIOCGETRULES, &pcr) < 0) + return (-1); + while ((int)--pcr.nr >= 0) { +- if (ioctl(fw->fd, DIOCGETRULE, &pcr) == 0 && +- pr_to_fr(&pcr.rule, &fr) == 0) { ++ if (pfctl_get_rule(fw->fd, pcr.nr, pcr.ticket, pcr.anchor, ++ pcr.action, &pfrule, pcr.anchor_call) == 0 && ++ pr_to_fr(&pfrule, &fr) == 0) { + if (_fw_cmp(rule, &fr) == 0) { + found = 1; + break; +@@ -282,6 +287,7 @@ fw_loop(fw_t *fw, fw_handler callback, void *arg) + fw_loop(fw_t *fw, fw_handler callback, void *arg) + { + struct pfioc_rule pr; ++ struct pfctl_rule pfrule; + struct fw_rule fr; + uint32_t n, max; + int ret = 0; +@@ -292,8 +298,9 @@ fw_loop(fw_t *fw, fw_handler callback, void *arg) + + for (n = 0, max = pr.nr; n < max; n++) { + pr.nr = n; +- +- if ((ret = ioctl(fw->fd, DIOCGETRULE, &pr)) < 0) ++ ++ if ((ret = pfctl_get_rule(fw->fd, pr.nr, pr.ticket, pr.anchor, ++ pr.action, &pfrule, pr.anchor_call)) < 0) + break; + #ifdef PF_TABLE_NAME_SIZE + /* XXX - actually in r1.125, not 1.126 */ +@@ -301,7 +308,7 @@ fw_loop(fw_t *fw, fw_handler callback, void *arg) + pr.rule.dst.addr.type == PF_ADDR_TABLE) + continue; + #endif +- if (pr_to_fr(&pr.rule, &fr) < 0) ++ if (pr_to_fr(&pfrule, &fr) < 0) + continue; + if ((ret = callback(&fr, arg)) != 0) + break;