aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/socket.c b/socket.c
index 5fe0683c..260d7cf2 100644
--- a/socket.c
+++ b/socket.c
@@ -25,14 +25,6 @@
#endif
#include "socket.h"
-#ifndef INADDR_NONE
-#ifdef INADDR_BROADCAST
-#define INADDR_NONE INADDR_BROADCAST
-#else
-#define INADDR_NONE -1
-#endif
-#endif
-
#ifdef SUNOS
#include <memory.h>
#endif
@@ -40,17 +32,13 @@
int SockOpen(char *host, int clientPort)
{
int sock;
- unsigned long inaddr;
struct sockaddr_in ad;
struct hostent *hp;
memset(&ad, 0, sizeof(ad));
ad.sin_family = AF_INET;
- inaddr = inet_addr(host);
- if (inaddr != INADDR_NONE)
- memcpy(&ad.sin_addr, &inaddr, sizeof(inaddr));
- else
+ if (!inet_aton(host, &ad.sin_addr)) /* accept a quad address */
{
hp = gethostbyname(host);