From 96703d22162836130ce696d99faa2a451db2b592 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Wed, 31 Aug 2022 06:41:53 -0700 Subject: [PATCH] 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(+) create mode 100644 net-mgmt/ipacctd/files/patch-src_ipacctd.c 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)