mirror of
https://github.com/bol-van/zapret.git
synced 2025-01-08 17:30:32 +05:00
dvtws: FreeBSD 14 beta2 compat
This commit is contained in:
parent
5b6ea0bf5d
commit
905be06154
Binary file not shown.
@ -922,6 +922,12 @@ static int rawsend_sendto_divert(sa_family_t family, int sock, const void *buf,
|
|||||||
socklen_t slen;
|
socklen_t slen;
|
||||||
|
|
||||||
memset(&sa,0,sizeof(sa));
|
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;
|
sa.ss_family = family;
|
||||||
switch(family)
|
switch(family)
|
||||||
{
|
{
|
||||||
@ -934,6 +940,7 @@ static int rawsend_sendto_divert(sa_family_t family, int sock, const void *buf,
|
|||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return sendto(sock, buf, len, 0, (struct sockaddr*)&sa, slen);
|
return sendto(sock, buf, len, 0, (struct sockaddr*)&sa, slen);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user