diff options
author | Christian Pointner <equinox@spreadspace.org> | 2010-12-03 01:46:39 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2010-12-03 01:46:39 +0000 |
commit | 93171b004f7e118f115d123026d8a60a64c6cd0b (patch) | |
tree | 97f7e023381b55b673303b3ee5bb5da50b9caf2d /src/tcp.c | |
parent | updated readme (new build deps +flex +bison) (diff) |
passive resolvon for listen sockets only
git-svn-id: https://svn.spreadspace.org/tcpproxy/trunk@26 e61f0598-a718-4e21-a8f0-0aadfa62ad6b
Diffstat (limited to 'src/tcp.c')
-rw-r--r-- | src/tcp.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -58,14 +58,15 @@ char* tcp_endpoint_to_string(tcp_endpoint_t e) return ret; } -struct addrinfo* tcp_resolve_endpoint(const char* addr, const char* port, resolv_type_t rt) +struct addrinfo* tcp_resolve_endpoint(const char* addr, const char* port, resolv_type_t rt, int passive) { struct addrinfo hints, *res; res = NULL; memset (&hints, 0, sizeof (hints)); hints.ai_socktype = SOCK_STREAM; - hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; + if(passive) + hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; switch(rt) { case IPV4_ONLY: hints.ai_family = AF_INET; break; |