diff --git a/src/xpdev/sockwrap.h b/src/xpdev/sockwrap.h
index 9896248059a4e21529ecfbd36536b4bed5fb50d5..a7501ef2364e9335590b008983d2eb300827b584 100644
--- a/src/xpdev/sockwrap.h
+++ b/src/xpdev/sockwrap.h
@@ -59,6 +59,7 @@
 #include <netdb.h>			/* gethostbyname */
 #include <sys/types.h>		/* For u_int32_t on FreeBSD */
 #include <netinet/in.h>		/* IPPROTO_IP */
+#include <sys/un.h>
 /* define _BSD_SOCKLEN_T_ in order to define socklen_t on darwin */
 #ifdef __DARWIN__
 #define _BSD_SOCKLEN_T_	int
@@ -86,6 +87,20 @@ typedef struct {
 	int		value;
 } socket_option_t;
 
+/*
+ * Fancy sockaddr_* union
+ */
+union xp_sockaddr {
+	struct sockaddr			addr;
+	struct sockaddr_in		in;
+	struct sockaddr_in6		in6;
+#ifndef _WIN32
+	struct sockaddr_un		un;
+#endif
+	struct sockaddr_storage	store;
+};
+ 
+
 /**********************************/
 /* Socket Implementation-specific */
 /**********************************/