diff options
Diffstat (limited to 'src/inet.c')
-rw-r--r-- | src/inet.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -209,8 +209,8 @@ const char *inet_tryconnect(p_sock ps, const char *address, | |||
209 | memset(&remote, 0, sizeof(remote)); | 209 | memset(&remote, 0, sizeof(remote)); |
210 | remote.sin_family = AF_INET; | 210 | remote.sin_family = AF_INET; |
211 | remote.sin_port = htons(port); | 211 | remote.sin_port = htons(port); |
212 | if (strcmp(address, "*")) { | 212 | if (strcmp(address, "*")) { |
213 | if (!strlen(address) || !inet_aton(address, &remote.sin_addr)) { | 213 | if (!inet_aton(address, &remote.sin_addr)) { |
214 | struct hostent *hp = NULL; | 214 | struct hostent *hp = NULL; |
215 | struct in_addr **addr; | 215 | struct in_addr **addr; |
216 | err = sock_gethostbyname(address, &hp); | 216 | err = sock_gethostbyname(address, &hp); |
@@ -236,8 +236,7 @@ const char *inet_trybind(p_sock ps, const char *address, unsigned short port) | |||
236 | local.sin_addr.s_addr = htonl(INADDR_ANY); | 236 | local.sin_addr.s_addr = htonl(INADDR_ANY); |
237 | local.sin_port = htons(port); | 237 | local.sin_port = htons(port); |
238 | local.sin_family = AF_INET; | 238 | local.sin_family = AF_INET; |
239 | if (strcmp(address, "*") && | 239 | if (strcmp(address, "*") && !inet_aton(address, &local.sin_addr)) { |
240 | (!strlen(address) || !inet_aton(address, &local.sin_addr))) { | ||
241 | struct hostent *hp = NULL; | 240 | struct hostent *hp = NULL; |
242 | struct in_addr **addr; | 241 | struct in_addr **addr; |
243 | err = sock_gethostbyname(address, &hp); | 242 | err = sock_gethostbyname(address, &hp); |