summaryrefslogtreecommitdiff
path: root/netcon/Intercept.c
diff options
context:
space:
mode:
authorJoseph Henry <josephjah@gmail.com>2016-01-13 12:19:48 -0800
committerJoseph Henry <josephjah@gmail.com>2016-01-13 12:19:48 -0800
commitc3e2cb9b8e6b187dc827704c69a2fbb4b5cf2909 (patch)
tree42f145dd8b22f6a93f7963c6084b5f509e5b39a6 /netcon/Intercept.c
parentbdabe40c65fd2205140902c0a62dfea2ab92fced (diff)
downloadinfinitytier-c3e2cb9b8e6b187dc827704c69a2fbb4b5cf2909.tar.gz
infinitytier-c3e2cb9b8e6b187dc827704c69a2fbb4b5cf2909.zip
Modified PCB/state management logic
Diffstat (limited to 'netcon/Intercept.c')
-rw-r--r--netcon/Intercept.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/netcon/Intercept.c b/netcon/Intercept.c
index 40c90957..8e479d84 100644
--- a/netcon/Intercept.c
+++ b/netcon/Intercept.c
@@ -71,7 +71,7 @@ we simply ask the service via an RPC */
static int connected_to_service(int sockfd)
{
- dwr(MSG_DEBUG_EXTRA,"connected_to_service():\n");
+ dwr(MSG_DEBUG,"connected_to_service():\n");
socklen_t len;
struct sockaddr_storage addr;
len = sizeof addr;
@@ -80,11 +80,11 @@ static int connected_to_service(int sockfd)
if (addr.ss_family == AF_LOCAL || addr.ss_family == AF_LOCAL) {
addr_un = (struct sockaddr_un*)&addr;
if(strcmp(addr_un->sun_path, netpath) == 0) {
- dwr(MSG_DEBUG_EXTRA,"connected_to_service(): Yes, %s\n", addr_un->sun_path);
+ dwr(MSG_DEBUG,"connected_to_service(): Yes, %s\n", addr_un->sun_path);
return 1;
}
}
- dwr(MSG_DEBUG_EXTRA,"connected_to_service(): Not connected to service\n");
+ dwr(MSG_DEBUG,"connected_to_service(): Not connected to service\n");
return 0;
}
@@ -488,7 +488,7 @@ int getsockname(GETSOCKNAME_SIG)
return realgetsockname(sockfd, addr, addrlen);
dwr(MSG_DEBUG,"getsockname(%d)\n", sockfd);
- if(connected_to_service(sockfd) == 0) {
+ if(!connected_to_service(sockfd)) {
dwr(MSG_DEBUG,"getsockname(): not used by service\n");
return realgetsockname(sockfd, addr, addrlen);
}
@@ -507,8 +507,8 @@ int getsockname(GETSOCKNAME_SIG)
if(rpcfd > -1)
if(read(rpcfd, &addrbuf, sizeof(struct sockaddr_storage)) > 0)
- close(rpcfd);
-
+ close(rpcfd);
+
struct sockaddr_storage sock_storage;
memcpy(&sock_storage, addrbuf, sizeof(struct sockaddr_storage));
*addrlen = sizeof(struct sockaddr_in);