From 905be061541923f3e63a753e0e6b3bb4d14eaa4e Mon Sep 17 00:00:00 2001 From: bol-van Date: Thu, 21 Sep 2023 13:01:09 +0300 Subject: [PATCH] dvtws: FreeBSD 14 beta2 compat --- binaries/freebsd-x64/dvtws | Bin 97848 -> 97848 bytes nfq/darkmagic.c | 7 +++++++ 2 files changed, 7 insertions(+) diff --git a/binaries/freebsd-x64/dvtws b/binaries/freebsd-x64/dvtws index aa3a2e92b98830c0ddbe58398257b85a23e3c8b5..126fe0924343bce1af3bbdfadfb5e1aaf29873c8 100755 GIT binary patch delta 35 tcmV+;0Nnq$`~|rD1+b7=4FXJ!g;4+h|1rryxe&9RSt?!u2eZhxaK=995o-Vd delta 35 tcmV+;0Nnq$`~|rD1+b7=4IE63g;4+h|1rryxg4{dSt?!u1GC7taK=IQ5sd%< diff --git a/nfq/darkmagic.c b/nfq/darkmagic.c index 29ac3d2..17cb6c2 100644 --- a/nfq/darkmagic.c +++ b/nfq/darkmagic.c @@ -922,6 +922,12 @@ static int rawsend_sendto_divert(sa_family_t family, int sock, const void *buf, socklen_t slen; memset(&sa,0,sizeof(sa)); +#ifdef __FreeBSD__ + // since FreeBSD 14 it requires hardcoded ipv4 values, although can also send ipv6 frames + sa.ss_family = AF_INET; + slen = sizeof(struct sockaddr_in); +#else + // OpenBSD requires correct family and size sa.ss_family = family; switch(family) { @@ -934,6 +940,7 @@ static int rawsend_sendto_divert(sa_family_t family, int sock, const void *buf, default: return -1; } +#endif return sendto(sock, buf, len, 0, (struct sockaddr*)&sa, slen); } #endif