mirror of
https://github.com/bol-van/zapret.git
synced 2025-01-19 12:42:21 +03:00
dvtws: do not fill excessive memory buffer
This commit is contained in:
parent
905be06154
commit
57486daa25
Binary file not shown.
@ -921,14 +921,12 @@ static int rawsend_sendto_divert(sa_family_t family, int sock, const void *buf,
|
|||||||
struct sockaddr_storage sa;
|
struct sockaddr_storage sa;
|
||||||
socklen_t slen;
|
socklen_t slen;
|
||||||
|
|
||||||
memset(&sa,0,sizeof(sa));
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
// since FreeBSD 14 it requires hardcoded ipv4 values, although can also send ipv6 frames
|
// since FreeBSD 14 it requires hardcoded ipv4 values, although can also send ipv6 frames
|
||||||
sa.ss_family = AF_INET;
|
family = AF_INET;
|
||||||
slen = sizeof(struct sockaddr_in);
|
slen = sizeof(struct sockaddr_in);
|
||||||
#else
|
#else
|
||||||
// OpenBSD requires correct family and size
|
// OpenBSD requires correct family and size
|
||||||
sa.ss_family = family;
|
|
||||||
switch(family)
|
switch(family)
|
||||||
{
|
{
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
@ -941,6 +939,8 @@ static int rawsend_sendto_divert(sa_family_t family, int sock, const void *buf,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
memset(&sa,0,slen);
|
||||||
|
sa.ss_family = family;
|
||||||
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