summaryrefslogtreecommitdiff
path: root/ext/socket/rubysocket.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/socket/rubysocket.h')
-rw-r--r--ext/socket/rubysocket.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/socket/rubysocket.h b/ext/socket/rubysocket.h
index ea225b8247..d06516f15a 100644
--- a/ext/socket/rubysocket.h
+++ b/ext/socket/rubysocket.h
@@ -151,6 +151,18 @@ struct sockaddr_storage {
};
#endif
+typedef union {
+ struct sockaddr addr;
+ struct sockaddr_in in;
+#ifdef AF_INET6
+ struct sockaddr_in6 in6;
+#endif
+#ifdef HAVE_TYPE_STRUCT_SOCKADDR_UN
+ struct sockaddr_un un;
+#endif
+ struct sockaddr_storage storage;
+} union_sockaddr;
+
#ifdef __APPLE__
/*
* CMSG_ macros are broken on 64bit darwin, because __DARWIN_ALIGN