about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/www_tcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'WWW/Library/Implementation/www_tcp.h')
-rw-r--r--WWW/Library/Implementation/www_tcp.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h
index 9de8ea51..f3f5ac65 100644
--- a/WWW/Library/Implementation/www_tcp.h
+++ b/WWW/Library/Implementation/www_tcp.h
@@ -830,6 +830,10 @@ typedef struct sockaddr_in SockA;  /* See netinet/in.h */
 #ifdef SIN6_LEN
 #define SOCKADDR_LEN(soc_address) ((struct sockaddr *)&soc_address)->sa_len
 #else
+#ifndef SA_LEN
+#define SA_LEN(x) (((x)->sa_family == AF_INET6)?sizeof(struct sockaddr_in6): \
+       (((x)->sa_family == AF_INET)?sizeof(struct sockaddr_in):sizeof(struct sockaddr)))
+#endif
 #define SOCKADDR_LEN(soc_address) SA_LEN((struct sockaddr *)&soc_address)
 #endif /* SIN6_LEN */
 #else