From 8189b2ba919f2c8276cf3e5b3df3643830350669 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Fri, 11 Sep 2015 19:29:35 -0400 Subject: [PATCH] retval fix --- netcon/Intercept.h | 4 ++-- netcon/NetconEthernetTap.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/netcon/Intercept.h b/netcon/Intercept.h index 30d118cf9..5c154e6e1 100755 --- a/netcon/Intercept.h +++ b/netcon/Intercept.h @@ -175,7 +175,7 @@ struct shutdown_st /* LWIP error beautification */ -/* + const char *lwiperror(int n) { switch(n) @@ -216,6 +216,6 @@ const char *lwiperror(int n) return "UNKNOWN_RET_VAL"; } } -*/ + #endif diff --git a/netcon/NetconEthernetTap.cpp b/netcon/NetconEthernetTap.cpp index 53818b92e..e7e38939e 100644 --- a/netcon/NetconEthernetTap.cpp +++ b/netcon/NetconEthernetTap.cpp @@ -652,6 +652,7 @@ void NetconEthernetTap::handle_retval(NetconClient *client, unsigned char* buf) { if(client->unmapped_conn != NULL) { memcpy(&(client->unmapped_conn->their_fd), &buf[1], sizeof(int)); + client->connections.push_back(client->unmapped_conn); client->unmapped_conn = NULL; } } @@ -703,6 +704,7 @@ void NetconEthernetTap::handle_connect(NetconClient *client, struct connect_st* // that's it! // - Most instances of a retval for a connect() should happen // in the nc_connect() and nc_err() callbacks! + fprintf(stderr, "failed to connect: %s\n", lwiperror(err)); send_return_value(client, err); } // Everything seems to be ok, but we don't have enough info to retval