chiark / gitweb /
ipv6: introduce union iaddr
[secnet.git] / secnet.h
index 16d49596ba0baa2609c2431894fa6cd199524afe..54f84ef3ae2ecb9a27dd366dfc7c76f94b0d1d65 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -30,6 +30,11 @@ typedef const char *cstring_t;
 #define True  (_Bool)1
 typedef _Bool bool_t;
 
+union iaddr {
+    struct sockaddr sa;
+    struct sockaddr_in sin;
+};
+
 #define ASSERT(x) do { if (!(x)) { fatal("assertion failed line %d file " \
                                         __FILE__,__LINE__); } } while(0)
 
@@ -333,7 +338,7 @@ struct comm_addr {
        must start by memsetting it with FILLZERO, or some
        equivalent. */
     struct comm_if *comm;
-    struct sockaddr_in sin;
+    union iaddr ia;
 };
 
 /* Return True if the packet was processed, and shouldn't be passed to