chiark / gitweb /
udp proxy: Properly zero holes in proxied address
[secnet.git] / secnet.h
index 2efd11dda5aadb1aa4ea75edbce144c0a37ab22e..34f24fe5047e8aafcd54bdad0ef4467d9c4edb2e 100644 (file)
--- a/secnet.h
+++ b/secnet.h
@@ -30,6 +30,14 @@ typedef const char *cstring_t;
 #define True  (_Bool)1
 typedef _Bool bool_t;
 
+union iaddr {
+    struct sockaddr sa;
+    struct sockaddr_in sin;
+#ifdef CONFIG_IPV6
+    struct sockaddr_in6 sin6;
+#endif
+};
+
 #define ASSERT(x) do { if (!(x)) { fatal("assertion failed line %d file " \
                                         __FILE__,__LINE__); } } while(0)
 
@@ -333,7 +341,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