diff options
Diffstat (limited to 'netcon')
-rw-r--r-- | netcon/NetconEthernetTap.cpp | 8 | ||||
-rwxr-xr-x | netcon/intercept.c | 11 | ||||
-rwxr-xr-x | netcon/libintercept.so.1.0 | bin | 53656 -> 53768 bytes |
3 files changed, 12 insertions, 7 deletions
diff --git a/netcon/NetconEthernetTap.cpp b/netcon/NetconEthernetTap.cpp index 0921f460..5fae5785 100644 --- a/netcon/NetconEthernetTap.cpp +++ b/netcon/NetconEthernetTap.cpp @@ -951,7 +951,7 @@ void NetconEthernetTap::handle_listen(PhySocket *sock, void **uptr, struct liste [I] EINVAL - Unknown protocol, or protocol family not available. [I] EINVAL - Invalid flags in type. [I] EMFILE - Process file table overflow. - [i] ENFILE - The system limit on the total number of open files has been reached. + [?] ENFILE - The system limit on the total number of open files has been reached. [X] ENOBUFS or ENOMEM - Insufficient memory is available. The socket cannot be created until sufficient resources are freed. [?] EPROTONOSUPPORT - The protocol type or the specified protocol is not supported within this domain. @@ -1004,10 +1004,10 @@ void NetconEthernetTap::handle_socket(PhySocket *sock, void **uptr, struct socke - := Not needed [-] EACCES - For UNIX domain sockets, which are identified by pathname: Write permission is denied ... - [ ] EACCES, EPERM - The user tried to connect to a broadcast address without having the socket broadcast flag enabled ... + [?] EACCES, EPERM - The user tried to connect to a broadcast address without having the socket broadcast flag enabled ... [i] EADDRINUSE - Local address is already in use. - [?] EAFNOSUPPORT - The passed address didn't have the correct address family in its sa_family field. - [ ] EAGAIN - No more free local ports or insufficient entries in the routing cache. + [I] EAFNOSUPPORT - The passed address didn't have the correct address family in its sa_family field. + [?] EAGAIN - No more free local ports or insufficient entries in the routing cache. [ ] EALREADY - The socket is nonblocking and a previous connection attempt has not yet been completed. [I] EBADF - The file descriptor is not a valid index in the descriptor table. [ ] ECONNREFUSED - No-one listening on the remote address. diff --git a/netcon/intercept.c b/netcon/intercept.c index 4762b309..4e87e36a 100755 --- a/netcon/intercept.c +++ b/netcon/intercept.c @@ -607,6 +607,9 @@ int socket(SOCKET_SIG) connect() intercept function */ int connect(CONNECT_SIG) { + struct sockaddr_in *connaddr; + connaddr = (struct sockaddr_in *) __addr; + #ifdef CHECKS /* Check that this is a valid fd */ if(fcntl(__fd, F_GETFD) < 0) { @@ -620,6 +623,11 @@ int connect(CONNECT_SIG) errno = ENOTSOCK; return -1; } + /* Check family */ + if (connaddr->sin_family < 0 || connaddr->sin_family >= NPROTO){ + errno = EAFNOSUPPORT; + return -1; + } /* FIXME: Check that address is in user space, return EFAULT ? */ #endif @@ -637,9 +645,6 @@ int connect(CONNECT_SIG) return(realconnect(__fd, __addr, __len)); } - struct sockaddr_in *connaddr; - connaddr = (struct sockaddr_in *) __addr; - if(__addr != NULL && (connaddr->sin_family == AF_LOCAL || connaddr->sin_family == PF_NETLINK || connaddr->sin_family == AF_NETLINK diff --git a/netcon/libintercept.so.1.0 b/netcon/libintercept.so.1.0 Binary files differindex 106c8c20..dc8ca9dc 100755 --- a/netcon/libintercept.so.1.0 +++ b/netcon/libintercept.so.1.0 |