aboutsummaryrefslogtreecommitdiff
path: root/src/inet.c
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2011-05-25 20:57:22 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2011-05-25 20:57:22 +0000
commit3a8ba90dfb0c2eb224f317dd692ede426691e72a (patch)
treefe1cc5379a2e0e031663fe9c15d908653844bc73 /src/inet.c
parentbce60be30fe8e9c1b0eb33128c23c93d7bca5303 (diff)
downloadluasocket-3a8ba90dfb0c2eb224f317dd692ede426691e72a.tar.gz
luasocket-3a8ba90dfb0c2eb224f317dd692ede426691e72a.tar.bz2
luasocket-3a8ba90dfb0c2eb224f317dd692ede426691e72a.zip
Saving before big changes to support IPv6.
Diffstat (limited to 'src/inet.c')
-rw-r--r--src/inet.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/inet.c b/src/inet.c
index 32f0cd2..862288c 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -213,7 +213,7 @@ const char *inet_tryconnect(p_socket ps, const char *address,
213 memset(&remote, 0, sizeof(remote)); 213 memset(&remote, 0, sizeof(remote));
214 remote.sin_family = AF_INET; 214 remote.sin_family = AF_INET;
215 remote.sin_port = htons(port); 215 remote.sin_port = htons(port);
216 if (strcmp(address, "*")) { 216 if (strcmp(address, "*")) {
217 if (!inet_aton(address, &remote.sin_addr)) { 217 if (!inet_aton(address, &remote.sin_addr)) {
218 struct hostent *hp = NULL; 218 struct hostent *hp = NULL;
219 struct in_addr **addr; 219 struct in_addr **addr;
@@ -248,7 +248,6 @@ const char *inet_trybind(p_socket ps, const char *address, unsigned short port)
248 memcpy(&local.sin_addr, *addr, sizeof(struct in_addr)); 248 memcpy(&local.sin_addr, *addr, sizeof(struct in_addr));
249 } 249 }
250 err = socket_bind(ps, (SA *) &local, sizeof(local)); 250 err = socket_bind(ps, (SA *) &local, sizeof(local));
251 if (err != IO_DONE) socket_destroy(ps);
252 return socket_strerror(err); 251 return socket_strerror(err);
253} 252}
254 253