Minor changes

This commit is contained in:
Joseph Henry 2015-09-24 15:30:07 -04:00
parent 0027a1e152
commit 851e4c667f
3 changed files with 8 additions and 5 deletions

View File

@ -197,7 +197,7 @@ public:
~LWIPStack() ~LWIPStack()
{ {
if (lebref) if (libref)
dlclose(libref); dlclose(libref);
} }
}; };

View File

@ -30,6 +30,7 @@
#include <algorithm> #include <algorithm>
#include <utility> #include <utility>
#include <dlfcn.h> #include <dlfcn.h>
//#include <sys/types.h>
#include "NetconEthernetTap.hpp" #include "NetconEthernetTap.hpp"
@ -165,6 +166,8 @@ std::vector<InetAddress> NetconEthernetTap::ips() const
void NetconEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len) void NetconEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len)
{ {
//fprintf(stderr, "__put(): tid = %d\n", gettid());
struct pbuf *p,*q; struct pbuf *p,*q;
//fprintf(stderr, "_put(%s,%s,%.4x,[data],%u)\n",from.toString().c_str(),to.toString().c_str(),etherType,len); //fprintf(stderr, "_put(%s,%s,%.4x,[data],%u)\n",from.toString().c_str(),to.toString().c_str(),etherType,len);
if (!_enabled) if (!_enabled)
@ -624,7 +627,7 @@ err_t NetconEthernetTap::nc_recved(void *arg, struct tcp_pcb *tpcb, struct pbuf
if(n < p->len) { if(n < p->len) {
fprintf(stderr, "nc_recved(): unable to write entire pbuf to buffer\n"); fprintf(stderr, "nc_recved(): unable to write entire pbuf to buffer\n");
} }
tap->lwipstack->tcp_recved(tpcb, n); tap->lwipstack->tcp_recved(tpcb, n); // TODO: would it be more efficient to call this once at the end?
} }
else { else {
fprintf(stderr, "nc_recved(): No data written to intercept buffer\n"); fprintf(stderr, "nc_recved(): No data written to intercept buffer\n");
@ -673,7 +676,7 @@ void NetconEthernetTap::nc_err(void *arg, err_t err)
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)
{ {
//fprintf(stderr, "nc_sent\n"); //fprintf(stderr, "nc_sent\n");
return len; return ERR_OK;
} }
/* /*
@ -696,7 +699,7 @@ err_t NetconEthernetTap::nc_connected(void *arg, struct tcp_pcb *tpcb, err_t err
tap->send_return_value(tap->clients[i],err); tap->send_return_value(tap->clients[i],err);
} }
} }
return err; return ERR_OK;
} }

View File

@ -83,7 +83,7 @@ namespace ZeroTier {
class NetconClient class NetconClient
{ {
public: public:
vector<NetconConnection*> connections; vector<NetconConnection*> connections; // TODO: Switch to storing the actual object here
int tid; int tid;
bool waiting_for_retval; bool waiting_for_retval;