X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=secnet.h;h=34f24fe5047e8aafcd54bdad0ef4467d9c4edb2e;hb=e6647c6ddf1dfaf35b2f70b2d453b63b2ce293e1;hp=2efd11dda5aadb1aa4ea75edbce144c0a37ab22e;hpb=ee226369193a35e6883d1031261205d2db4693b9;p=secnet.git diff --git a/secnet.h b/secnet.h index 2efd11d..34f24fe 100644 --- 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