summaryrefslogtreecommitdiff
path: root/ext/socket/sockport.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/sockport.h')
-rw-r--r--ext/socket/sockport.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/socket/sockport.h b/ext/socket/sockport.h
index d536bbf9ede..6d3344ecd89 100644
--- a/ext/socket/sockport.h
+++ b/ext/socket/sockport.h
@@ -13,22 +13,29 @@
#ifndef SA_LEN
# ifdef HAVE_SA_LEN
# define SA_LEN(sa) (sa)->sa_len
+# define SS_LEN(ss) (ss)->ss_len
# else
# ifdef AF_INET6
# define SA_LEN(sa) \
(((sa)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) \
: sizeof(struct sockaddr))
+# define SS_LEN(ss) \
+ (((ss)->ss_family == AF_INET6) ? sizeof(struct sockaddr_in6) \
+ : sizeof(struct sockaddr))
# else
/* by tradition, sizeof(struct sockaddr) covers most of the sockaddrs */
# define SA_LEN(sa) (sizeof(struct sockaddr))
+# define SS_LEN(ss) (sizeof(struct sockaddr))
# endif
# endif
#endif
#ifdef HAVE_SA_LEN
# define SET_SA_LEN(sa, len) (void)((sa)->sa_len = (len))
+# define SET_SS_LEN(ss, len) (void)((ss)->ss_len = (len))
#else
# define SET_SA_LEN(sa, len) (void)(len)
+# define SET_SS_LEN(ss, len) (void)(len)
#endif
#ifdef HAVE_SIN_LEN