mirror of
https://github.com/opnsense/src.git
synced 2026-04-26 08:37:50 -04:00
Set default socket size for netreceive to 128k to reduce the chances
of the buffer overflowing before netreceive can be scheduled to read the packets from the socket.
This commit is contained in:
parent
78366bad6c
commit
98da5dfbb2
1 changed files with 7 additions and 1 deletions
|
|
@ -52,7 +52,7 @@ main(int argc, char *argv[])
|
|||
struct sockaddr_in sin;
|
||||
char *dummy, *packet;
|
||||
long port;
|
||||
int s;
|
||||
int s, v;
|
||||
|
||||
if (argc != 2)
|
||||
usage();
|
||||
|
|
@ -80,6 +80,12 @@ main(int argc, char *argv[])
|
|||
return (-1);
|
||||
}
|
||||
|
||||
v = 128 * 1024;
|
||||
if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &v, sizeof(v)) < 0) {
|
||||
perror("SO_RCVBUF");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
|
||||
perror("bind");
|
||||
return (-1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue