--- l2_ch_socket.c 2001/09/10 06:41:59 1.21
+++ l2_ch_socket.c 2001/09/10 06:43:10 1.22
@@ -36,15 +36,16 @@
#include <arpa/inet.h>
#include "l2.h"
+#include "l2_config.h"
-#define HAVE_INET_ATON
-#ifndef HAVE_INET_PTON
-#ifdef HAVE_INET_ATON
+#if defined(HAVE_INET_PTON)
+#define l2_inet_pton inet_pton
+#elif defined(HAVE_INET_ATON)
/******************************************************************
IPv4 source used from Unix Network Programming by Richard STEVENS
******************************************************************/
-static int inet_pton(int iFamily, const char *pszAddress, void *pvMemref)
+static int l2_inet_pton(int iFamily, const char *pszAddress, void *pvMemref)
{
int i = 0;
struct in_addr IP4Addr;
@@ -82,7 +83,6 @@
#else
#error "neither inet_pton nor inet_aton available"
#endif
-#endif
/* declare private channel configuration */
typedef struct {
@@ -154,7 +154,7 @@
memset(&IP4Sockaddr, 0, sizeof(IP4Sockaddr));
/* resolve host numerically */
- if (inet_pton(AF_INET, cfg->pszHost, &IP4Sockaddr.sin_addr.s_addr) == 1) {
+ if (l2_inet_pton(AF_INET, cfg->pszHost, &IP4Sockaddr.sin_addr.s_addr) == 1) {
IP4Sockaddr.sin_family = AF_INET;
IP4Sockaddr.sin_port = htons(cfg->iPort);
}
@@ -215,7 +215,7 @@
memset(&IP6Sockaddr, 0, sizeof(IP6Sockaddr));
/* resolve host numerically */
- if (inet_pton(AF_INET6, cfg->pszHost, &IP6Sockaddr.sin6_addr.s6_addr) == 1) {
+ if (l2_inet_pton(AF_INET6, cfg->pszHost, &IP6Sockaddr.sin6_addr.s6_addr) == 1) {
IP6Sockaddr.sin6_family = AF_INET6;
IP6Sockaddr.sin6_port = htons(cfg->iPort);
}
|