改为阻塞方式读写tun。

This commit is contained in:
zhengchao
2019-01-25 19:26:56 +06:00
parent 840b3026eb
commit ae670607b9

View File

@@ -351,7 +351,7 @@ int tun_alloc_mq(char *dev, int queues, int *fds,char* tun_path)
tun_error(i,fds);
return -1;
}
/*
//20180618 add set noblock
flag= fcntl(fd, F_GETFL, 0);
if(flag<0)
@@ -363,7 +363,7 @@ int tun_alloc_mq(char *dev, int queues, int *fds,char* tun_path)
{
MESA_handle_runtime_log(g_kni_comminfo.logger, RLOG_LV_FATAL,KNI_MODULE_INIT,"fcntl():setfl error,errno is:%d,%s",errno,strerror(errno));
}
*/
//end
fds[i] = fd;
@@ -906,7 +906,7 @@ int tun_read_data(int fd, char* buffer, size_t size)
int ret=0;
int max_fd = 0;
/*
if(g_kni_switch_info.write_listq_switch == 0)
{
fd_set alive_readfd;
@@ -926,7 +926,7 @@ int tun_read_data(int fd, char* buffer, size_t size)
return 0;
}
}
*/
recv_len = read(fd, buffer, size);
if(recv_len <0)
{