git: 96703d221628 - main - net-mgmt/ipacctd: use PF_DIVERT on FreeBSD 14

From: Gleb Smirnoff <glebius_at_FreeBSD.org>
Date: Wed, 31 Aug 2022 13:42:16 UTC
The branch main has been updated by glebius (src committer):

URL: https://cgit.FreeBSD.org/ports/commit/?id=96703d22162836130ce696d99faa2a451db2b592

commit 96703d22162836130ce696d99faa2a451db2b592
Author:     Gleb Smirnoff <glebius@FreeBSD.org>
AuthorDate: 2022-08-31 13:41:53 +0000
Commit:     Gleb Smirnoff <glebius@FreeBSD.org>
CommitDate: 2022-08-31 13:41:53 +0000

    net-mgmt/ipacctd: use PF_DIVERT on FreeBSD 14
    
    to avoid runtime warning.
    
    Approved by:    mikael
---
 net-mgmt/ipacctd/Makefile                  |  1 +
 net-mgmt/ipacctd/files/patch-src_ipacctd.c | 14 ++++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/net-mgmt/ipacctd/Makefile b/net-mgmt/ipacctd/Makefile
index 4675469a1dc2..42dc70c29457 100644
--- a/net-mgmt/ipacctd/Makefile
+++ b/net-mgmt/ipacctd/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	ipacctd
 PORTVERSION=	1.47
+PORTREVISION=	1
 CATEGORIES=	net-mgmt
 MASTER_SITES=	LOCAL/skv
 
diff --git a/net-mgmt/ipacctd/files/patch-src_ipacctd.c b/net-mgmt/ipacctd/files/patch-src_ipacctd.c
new file mode 100644
index 000000000000..8fd8c9e490d5
--- /dev/null
+++ b/net-mgmt/ipacctd/files/patch-src_ipacctd.c
@@ -0,0 +1,14 @@
+--- src/ipacctd.c.orig	2022-08-30 21:59:34 UTC
++++ src/ipacctd.c
+@@ -232,7 +232,11 @@
+ 	
+ 	ds.sin_family = AF_INET;
+ 
++#ifdef PF_DIVERT
++	if ((spkt = socket(PF_DIVERT, SOCK_RAW, 0)) == -1)
++#else
+ 	if ((spkt = socket(PF_INET, SOCK_RAW, IPPROTO_DIVERT)) == -1)
++#endif
+ 		err(1, "socket(IP_DIVERT)");
+ 	
+ 	if ((bind(spkt, (struct sockaddr *)&ds, sizeof(ds))) == -1)