dvtws fix socket buffers

This commit is contained in:
bol-van
2024-03-08 14:01:24 +03:00
parent 70fa1dbea7
commit 48850b5f4e
4 changed files with 15 additions and 10 deletions

View File

@@ -903,14 +903,8 @@ static int *rawsend_family_sock(sa_family_t family)
}
#ifdef BSD
int rawsend_socket_divert(sa_family_t family)
int socket_divert(sa_family_t family)
{
// HACK HACK HACK HACK HACK HACK HACK HACK
// FreeBSD doesnt allow IP_HDRINCL for IPV6
// OpenBSD doesnt allow rawsending tcp frames
// we either have to go to the link layer (its hard, possible problems arise, compat testing, ...) or use some HACKING
// from my point of view disabling direct ability to send ip frames is not security. its SHIT
int fd;
#ifdef __FreeBSD__
@@ -921,6 +915,17 @@ int rawsend_socket_divert(sa_family_t family)
#endif
// freebsd13- or openbsd way
fd = socket(family, SOCK_RAW, IPPROTO_DIVERT);
return fd;
}
static int rawsend_socket_divert(sa_family_t family)
{
// HACK HACK HACK HACK HACK HACK HACK HACK
// FreeBSD doesnt allow IP_HDRINCL for IPV6
// OpenBSD doesnt allow rawsending tcp frames
// we either have to go to the link layer (its hard, possible problems arise, compat testing, ...) or use some HACKING
// from my point of view disabling direct ability to send ip frames is not security. its SHIT
int fd = socket_divert(family);
if (fd!=-1 && !set_socket_buffers(fd,4096,RAW_SNDBUF))
{
close(fd);