diff --git a/nfq/darkmagic.c b/nfq/darkmagic.c index 66a2aa1..d41e511 100644 --- a/nfq/darkmagic.c +++ b/nfq/darkmagic.c @@ -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;