diff options
author | Joseph Henry <josephjah@gmail.com> | 2015-12-18 11:37:11 -0800 |
---|---|---|
committer | Joseph Henry <josephjah@gmail.com> | 2015-12-18 11:37:11 -0800 |
commit | fde8af9483e4923876cf845b68fc5fbef1fa5e43 (patch) | |
tree | 8d1da93552c1f72c880029c5556fe124d8ef014b /netcon | |
parent | c22c0a20f684de0a034926dcc7de05094b09f84f (diff) | |
download | infinitytier-fde8af9483e4923876cf845b68fc5fbef1fa5e43.tar.gz infinitytier-fde8af9483e4923876cf845b68fc5fbef1fa5e43.zip |
getsockopt() tweak
Diffstat (limited to 'netcon')
-rw-r--r-- | netcon/Intercept.c | 16 | ||||
-rw-r--r-- | netcon/NetconEthernetTap.cpp | 2 |
2 files changed, 13 insertions, 5 deletions
diff --git a/netcon/Intercept.c b/netcon/Intercept.c index 108a9e64..23d5f21d 100644 --- a/netcon/Intercept.c +++ b/netcon/Intercept.c @@ -159,6 +159,7 @@ static int get_retval() if(n_read > 0) { memcpy(&retval, &retbuf[1], sizeof(retval)); memcpy(&errno, &retbuf[1+sizeof(retval)], sizeof(errno)); + dwr(MSG_DEBUG, "get_retval(): ret = %d\n", retval); return retval; } } @@ -403,23 +404,28 @@ int getsockopt(GETSOCKOPT_SIG) return -1; } dwr(MSG_DEBUG,"getsockopt(%d)\n", sockfd); - /* - if(is_mapped_to_service(sockfd) < 0) { // First, check if the service manages this + + if(is_mapped_to_service(sockfd) <= 0) { // First, check if the service manages this return realgetsockopt(sockfd, level, optname, optval, optlen); } - */ - int err = realgetsockopt(sockfd, level, optname, optval, optlen); + //return 0; + + + //int err = realgetsockopt(sockfd, level, optname, optval, optlen); /* TODO: this condition will need a little more intelligence later on -- we will need to know if this fd is a local we are spoofing, or a true local */ + if(optname == SO_TYPE) { int* val = (int*)optval; *val = 2; optval = (void*)val; } + /* if(err < 0){ - perror("setsockopt():\n"); + perror("getsockopt():\n"); } + */ return 0; } diff --git a/netcon/NetconEthernetTap.cpp b/netcon/NetconEthernetTap.cpp index 0ec5d5c3..a0feae47 100644 --- a/netcon/NetconEthernetTap.cpp +++ b/netcon/NetconEthernetTap.cpp @@ -440,6 +440,8 @@ void NetconEthernetTap::die(int exret) { */ void NetconEthernetTap::closeConnection(TcpConnection *conn) { + //return; + //dwr(MSG_DEBUG, "closeConnection(): conn = 0x%x\n", conn); if(!conn) return; dwr(MSG_DEBUG, " closeConnection(%x, %d)\n", conn->pcb, _phy.getDescriptor(conn->dataSock)); |