From 9210337fa5c0144d8102bd12acf1a014bdd60f67 Mon Sep 17 00:00:00 2001 From: leitner Date: Thu, 7 Apr 2005 05:52:55 +0000 Subject: [PATCH] turns out there is one more error message that can signal missing IPv6 support in the kernel --- CHANGES | 1 + socket/socket_tcp6.c | 5 ++++- socket/socket_udp6.c | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 3d3f7ea..6fc49dd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,5 @@ 0.23: + also recognize EPFNOSUPPORT as EAFNOSUPPORT (groan) 0.22: uh, the scope_id detection #defined the wrong constant. libowfat diff --git a/socket/socket_tcp6.c b/socket/socket_tcp6.c index bef1eba..37a460d 100644 --- a/socket/socket_tcp6.c +++ b/socket/socket_tcp6.c @@ -11,6 +11,9 @@ #ifndef EAFNOSUPPORT #define EAFNOSUPPORT EINVAL #endif +#ifndef EPFNOSUPPORT +#define EPFNOSUPPORT EAFNOSUPPORT +#endif int socket_tcp6(void) { @@ -21,7 +24,7 @@ int socket_tcp6(void) if (noipv6) goto compat; s = winsock2errno(socket(PF_INET6,SOCK_STREAM,0)); if (s == -1) { - if (errno == EINVAL || errno == EAFNOSUPPORT) { + if (errno == EINVAL || errno == EAFNOSUPPORT || errno == EPFNOSUPPORT) { compat: s=socket(AF_INET,SOCK_STREAM,0); noipv6=1; diff --git a/socket/socket_udp6.c b/socket/socket_udp6.c index d783d99..9df778d 100644 --- a/socket/socket_udp6.c +++ b/socket/socket_udp6.c @@ -11,6 +11,9 @@ #ifndef EAFNOSUPPORT #define EAFNOSUPPORT EINVAL #endif +#ifndef EPFNOSUPPORT +#define EPFNOSUPPORT EAFNOSUPPORT +#endif int socket_udp6(void) { @@ -21,7 +24,7 @@ int socket_udp6(void) if (noipv6) goto compat; s = winsock2errno(socket(PF_INET6,SOCK_DGRAM,0)); if (s == -1) { - if (errno == EINVAL || errno == EAFNOSUPPORT) { + if (errno == EINVAL || errno == EAFNOSUPPORT || errno == EPFNOSUPPORT) { compat: s=winsock2errno(socket(AF_INET,SOCK_DGRAM,0)); noipv6=1;