mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Readme changes, turned off debug
This commit is contained in:
parent
de2ba8d0f7
commit
4267cc138e
4 changed files with 37 additions and 33 deletions
|
@ -135,9 +135,7 @@ static int init_service_connection()
|
||||||
|
|
||||||
strncpy(rpcname,network_id,sizeof(rpcname));
|
strncpy(rpcname,network_id,sizeof(rpcname));
|
||||||
instance_count++;
|
instance_count++;
|
||||||
rpcfd = rpc_join(rpcname);
|
return rpc_join(rpcname);
|
||||||
fprintf(stderr, "rpc_join = %d\n", rpcfd);
|
|
||||||
return rpcfd;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
|
@ -152,7 +150,7 @@ static void my_dest(void) {
|
||||||
|
|
||||||
static void load_symbols(void)
|
static void load_symbols(void)
|
||||||
{
|
{
|
||||||
if(thispid == getpid()) {
|
if(thispid == getpid()) {
|
||||||
dwr(MSG_DEBUG,"detected duplicate call to global constructor (pid=%d).\n", thispid);
|
dwr(MSG_DEBUG,"detected duplicate call to global constructor (pid=%d).\n", thispid);
|
||||||
}
|
}
|
||||||
thispid = getpid();
|
thispid = getpid();
|
||||||
|
@ -276,15 +274,6 @@ int socket(SOCKET_SIG)
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* Check that we haven't hit the soft-limit file descriptors allowed */
|
|
||||||
/* FIXME: Find number of open fds
|
|
||||||
struct rlimit rl;
|
|
||||||
getrlimit(RLIMIT_NOFILE, &rl);
|
|
||||||
if(sockfd >= rl.rlim_cur){
|
|
||||||
errno = EMFILE;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
/* TODO: detect ENFILE condition */
|
/* TODO: detect ENFILE condition */
|
||||||
|
|
||||||
if(socket_family == AF_LOCAL
|
if(socket_family == AF_LOCAL
|
||||||
|
@ -338,7 +327,6 @@ int connect(CONNECT_SIG)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
dwr(MSG_DEBUG,"connect(%d):\n", __fd);
|
dwr(MSG_DEBUG,"connect(%d):\n", __fd);
|
||||||
/* print_addr(__addr); */
|
|
||||||
struct sockaddr_in *connaddr;
|
struct sockaddr_in *connaddr;
|
||||||
connaddr = (struct sockaddr_in *) __addr;
|
connaddr = (struct sockaddr_in *) __addr;
|
||||||
|
|
||||||
|
|
|
@ -440,16 +440,9 @@ void NetconEthernetTap::die(int exret) {
|
||||||
*/
|
*/
|
||||||
void NetconEthernetTap::closeConnection(TcpConnection *conn)
|
void NetconEthernetTap::closeConnection(TcpConnection *conn)
|
||||||
{
|
{
|
||||||
//return;
|
|
||||||
//dwr(MSG_DEBUG, "closeConnection(): conn = 0x%x\n", conn);
|
|
||||||
if(!conn)
|
if(!conn)
|
||||||
return;
|
return;
|
||||||
dwr(MSG_DEBUG, " closeConnection(%x, %d)\n", conn->pcb, _phy.getDescriptor(conn->dataSock));
|
dwr(MSG_DEBUG, " closeConnection(%x, %d)\n", conn->pcb, _phy.getDescriptor(conn->dataSock));
|
||||||
//lwipstack->_tcp_sent(conn->pcb, NULL);
|
|
||||||
//lwipstack->_tcp_recv(conn->pcb, NULL);
|
|
||||||
//lwipstack->_tcp_err(conn->pcb, NULL);
|
|
||||||
//lwipstack->_tcp_poll(conn->pcb, NULL, 0);
|
|
||||||
//lwipstack->_tcp_arg(conn->pcb, NULL);
|
|
||||||
if(lwipstack->_tcp_close(conn->pcb) != ERR_OK) {
|
if(lwipstack->_tcp_close(conn->pcb) != ERR_OK) {
|
||||||
dwr(MSG_ERROR, " closeConnection(): Error while calling tcp_close()\n");
|
dwr(MSG_ERROR, " closeConnection(): Error while calling tcp_close()\n");
|
||||||
exit(0);
|
exit(0);
|
||||||
|
@ -876,7 +869,7 @@ err_t NetconEthernetTap::nc_recved(void *arg, struct tcp_pcb *tpcb, struct pbuf
|
||||||
|
|
||||||
if(!l->conn) {
|
if(!l->conn) {
|
||||||
dwr(MSG_ERROR, " nc_recved(): no connection object\n");
|
dwr(MSG_ERROR, " nc_recved(): no connection object\n");
|
||||||
return ERR_OK; // ?
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
if(p == NULL) {
|
if(p == NULL) {
|
||||||
if(l->conn && !l->conn->listening) {
|
if(l->conn && !l->conn->listening) {
|
||||||
|
@ -892,7 +885,7 @@ err_t NetconEthernetTap::nc_recved(void *arg, struct tcp_pcb *tpcb, struct pbuf
|
||||||
q = p;
|
q = p;
|
||||||
while(p != NULL) { // Cycle through pbufs and write them to the socket
|
while(p != NULL) { // Cycle through pbufs and write them to the socket
|
||||||
if(p->len <= 0)
|
if(p->len <= 0)
|
||||||
break; // ?
|
break;
|
||||||
if((n = l->tap->_phy.streamSend(l->conn->dataSock,p->payload, p->len)) > 0) {
|
if((n = l->tap->_phy.streamSend(l->conn->dataSock,p->payload, p->len)) > 0) {
|
||||||
if(n < p->len) {
|
if(n < p->len) {
|
||||||
dwr(MSG_INFO, " nc_recved(): unable to write entire pbuf to buffer\n");
|
dwr(MSG_INFO, " nc_recved(): unable to write entire pbuf to buffer\n");
|
||||||
|
@ -993,7 +986,7 @@ void NetconEthernetTap::nc_err(void *arg, err_t err)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dwr(MSG_ERROR, "nc_err(): closing connection\n");
|
dwr(MSG_ERROR, "nc_err(): closing connection\n");
|
||||||
l->tap->closeConnection(l->conn);
|
l->tap->closeConnection(l->conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1024,12 +1017,9 @@ err_t NetconEthernetTap::nc_poll(void* arg, struct tcp_pcb *tpcb)
|
||||||
*/
|
*/
|
||||||
err_t NetconEthernetTap::nc_sent(void* arg, struct tcp_pcb *tpcb, u16_t len)
|
err_t NetconEthernetTap::nc_sent(void* arg, struct tcp_pcb *tpcb, u16_t len)
|
||||||
{
|
{
|
||||||
//dwr(5, " nc_sent()\n");
|
|
||||||
Larg *l = (Larg*)arg;
|
Larg *l = (Larg*)arg;
|
||||||
if(len) {
|
if(len) {
|
||||||
l->conn->acked+=len;
|
l->conn->acked+=len;
|
||||||
//dwr("W = %d, A = %d\n", l->conn->written, l->conn->acked);
|
|
||||||
//dwr("ACK = %d\n", len);
|
|
||||||
l->tap->_phy.setNotifyReadable(l->conn->dataSock, true);
|
l->tap->_phy.setNotifyReadable(l->conn->dataSock, true);
|
||||||
l->tap->_phy.whack();
|
l->tap->_phy.whack();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,37 @@ The virtual TCP/IP stack will respond to *incoming* ICMP ECHO requests, which me
|
||||||
|
|
||||||
The following applications have been tested and confirmed to work for the beta release:
|
The following applications have been tested and confirmed to work for the beta release:
|
||||||
|
|
||||||
sshd [ WORKS as of 20151215 ] Fedora 22/23, Centos 7, Ubuntu 14.04
|
Fedora 23:
|
||||||
apache [ WORKS as of 20151215 ] 2.4.6 on Centos 7, 2.4.16 and 2.4.17 on Fedora 22/23
|
|
||||||
nginx [ WORKS as of 20151215 ] 1.8.0 on both Fedora 22/23 and Ubuntu 14.04
|
httpstub.c
|
||||||
nodejs [ WORKS as of 20151215 ] 4.2.2, 6.0.0-pre (note: some older LTS versions are known to have a connection accept bug)
|
nginx 1.8.0
|
||||||
redis-server [ WORKS as of 20151215 ] 3.0.4 on Fedora 22/23
|
http 2.4.16, 2.4.17
|
||||||
|
darkhttpd 1.11
|
||||||
|
python 2.7.10 (python -m SimpleHTTPServer)
|
||||||
|
python 3.4.3 (python -m http.server)
|
||||||
|
redis 3.0.4
|
||||||
|
node 6.0.0-pre
|
||||||
|
sshd
|
||||||
|
|
||||||
|
CentOS 7:
|
||||||
|
|
||||||
|
httpstub.c
|
||||||
|
nginx 1.6.3
|
||||||
|
httpd (debug mode -X)
|
||||||
|
darkhttpd 1.11
|
||||||
|
node 4.2.2
|
||||||
|
redis 2.8.19
|
||||||
|
sshd
|
||||||
|
|
||||||
|
Ubuntu 14.04.3:
|
||||||
|
|
||||||
|
httpstub.c
|
||||||
|
nginx 1.4.6
|
||||||
|
python 2.7.6 (python -m SimpleHTTPServer)
|
||||||
|
python 3.4.0 (python -m http.server)
|
||||||
|
node 5.2.0
|
||||||
|
redis 2.8.4
|
||||||
|
sshd
|
||||||
|
|
||||||
It is *likely* to work with other things but there are no guarantees.
|
It is *likely* to work with other things but there are no guarantees.
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#ifndef _COMMON_H
|
#ifndef _COMMON_H
|
||||||
#define _COMMON_H 1
|
#define _COMMON_H 1
|
||||||
|
|
||||||
#define DEBUG_LEVEL 4
|
#define DEBUG_LEVEL 0
|
||||||
|
|
||||||
#define MSG_WARNING 4
|
#define MSG_WARNING 4
|
||||||
#define MSG_ERROR 1 // Errors
|
#define MSG_ERROR 1 // Errors
|
||||||
|
|
Loading…
Add table
Reference in a new issue