deleted my exit

This commit is contained in:
wangyu
2017-07-31 07:51:31 +08:00
committed by wangyu
parent 63e7dbb240
commit 2245fbdb54
3 changed files with 52 additions and 59 deletions

View File

@@ -153,13 +153,13 @@ int init_raw_socket()
if(raw_send_fd == -1) {
mylog(log_fatal,"Failed to create raw_send_fd\n");
//perror("Failed to create raw_send_fd");
myexit(1);
exit(1);
}
if(setsockopt(raw_send_fd, SOL_SOCKET, SO_SNDBUFFORCE, &socket_buf_size, sizeof(socket_buf_size))<0)
{
mylog(log_fatal,"SO_SNDBUFFORCE fail\n");
myexit(1);
exit(1);
}
//raw_fd = socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_ALL));
@@ -168,13 +168,13 @@ int init_raw_socket()
if(raw_recv_fd == -1) {
mylog(log_fatal,"Failed to create raw_recv_fd\n");
//perror("");
myexit(1);
exit(1);
}
if(setsockopt(raw_recv_fd, SOL_SOCKET, SO_RCVBUFFORCE, &socket_buf_size, sizeof(socket_buf_size))<0)
{
mylog(log_fatal,"SO_RCVBUFFORCE fail\n");
myexit(1);
exit(1);
}
//IP_HDRINCL to tell the kernel that headers are included in the packet
@@ -184,7 +184,7 @@ int init_raw_socket()
if (setsockopt (raw_send_fd, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) {
mylog(log_fatal,"Error setting IP_HDRINCL %d\n",errno);
//perror("Error setting IP_HDRINCL");
myexit(2);
exit(2);
}
setnonblocking(raw_send_fd); //not really necessary
@@ -232,7 +232,7 @@ void init_filter(int port)
{
mylog(log_fatal,"error set fiter\n");
//perror("filter");
myexit(-1);
exit(-1);
}
}
void remove_filter()