net-mgmt/ipacctd: use PF_DIVERT on FreeBSD 14

to avoid runtime warning.

Approved by:	mikael
This commit is contained in:
Gleb Smirnoff 2022-08-31 06:41:53 -07:00
parent 976d9d5dd7
commit 96703d2216
2 changed files with 15 additions and 0 deletions

View File

@ -1,5 +1,6 @@
PORTNAME= ipacctd
PORTVERSION= 1.47
PORTREVISION= 1
CATEGORIES= net-mgmt
MASTER_SITES= LOCAL/skv

View File

@ -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)