mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2024-12-24 15:16:40 +00:00
Minor cleanup
This commit is contained in:
parent
b48ed824e6
commit
80a73cb14b
@ -103,9 +103,7 @@ void load_symbols(void);
|
||||
void set_up_intercept();
|
||||
int checkpid();
|
||||
|
||||
#define BUF_SZ 32
|
||||
#define SERVICE_CONNECT_ATTEMPTS 30
|
||||
#define ERR_OK 0
|
||||
|
||||
ssize_t sock_fd_read(int sock, void *buf, ssize_t bufsize, int *fd);
|
||||
|
||||
|
@ -31,6 +31,8 @@
|
||||
|
||||
#include <sys/socket.h>
|
||||
|
||||
#define BUF_SZ 32
|
||||
#define ERR_OK 0
|
||||
|
||||
/* Userland RPC codes */
|
||||
#define RPC_UNDEFINED 0
|
||||
|
@ -53,7 +53,6 @@
|
||||
#define ZT_LWIP_TCP_TIMER_INTERVAL 10
|
||||
#define STATUS_TMR_INTERVAL 500 // How often we check connection statuses
|
||||
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
NetconEthernetTap::NetconEthernetTap(
|
||||
@ -382,13 +381,15 @@ void NetconEthernetTap::threadMain()
|
||||
}
|
||||
if(!associated){
|
||||
// No TCP connections are associated, this is a candidate for removal
|
||||
char c;
|
||||
if(read(_phy.getDescriptor(rpc_sockets[i]),&c,1) < 0) {
|
||||
unsigned char tmpbuf[BUF_SZ];
|
||||
if(read(_phy.getDescriptor(rpc_sockets[i]),&tmpbuf,BUF_SZ) < 0) {
|
||||
closeClient(rpc_sockets[i]);
|
||||
}
|
||||
else {
|
||||
// Handle RPC call, this is rare
|
||||
// phyOnUnixData(PhySocket *sock,void **uptr,void *data,unsigned long len)
|
||||
fprintf(stderr, "run(): RPC read during connection check\n");
|
||||
exit(0);
|
||||
phyOnUnixData(rpc_sockets[i],NULL,&tmpbuf,BUF_SZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user