nfqws: move IP_NODEFRAG sockopt

This commit is contained in:
bol-van 2022-01-03 21:30:42 +03:00
parent 94433e3279
commit 78de2c2137

View File

@ -794,15 +794,6 @@ static int rawsend_socket_raw(int domain, int proto)
close(fd);
return -1;
}
#ifdef __linux__
int yes=1;
if (setsockopt(fd,IPPROTO_IP,IP_NODEFRAG,&yes,sizeof(yes)) == -1)
{
perror("rawsend: setsockopt(IP_NODEFRAG)");
close(fd);
return -1;
}
#endif
}
return fd;
}
@ -863,6 +854,11 @@ static int rawsend_socket(sa_family_t family,uint32_t fwmark)
perror("rawsend: setsockopt(SO_PRIORITY)");
goto exiterr;
}
if (setsockopt(*sock, IPPROTO_IP, IP_NODEFRAG, &yes, sizeof(yes)) == -1)
{
perror("rawsend: setsockopt(IP_NODEFRAG)");
goto exiterr;
}
#endif
}
return *sock;