summaryrefslogtreecommitdiff
path: root/src/socket-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/socket-util.h')
-rw-r--r--src/socket-util.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/socket-util.h b/src/socket-util.h
index 86c9e47809..b5cb2a844d 100644
--- a/src/socket-util.h
+++ b/src/socket-util.h
@@ -30,14 +30,16 @@
#include "macro.h"
#include "util.h"
+union sockaddr_union {
+ struct sockaddr sa;
+ struct sockaddr_in in4;
+ struct sockaddr_in6 in6;
+ struct sockaddr_un un;
+ struct sockaddr_storage storage;
+};
+
typedef struct SocketAddress {
- union {
- struct sockaddr sa;
- struct sockaddr_in in4;
- struct sockaddr_in6 in6;
- struct sockaddr_un un;
- struct sockaddr_storage storage;
- } sockaddr;
+ union sockaddr_union sockaddr;
/* We store the size here explicitly due to the weird
* sockaddr_un semantics for abstract sockets */