summaryrefslogtreecommitdiff
path: root/lib/if.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/if.h')
-rw-r--r--lib/if.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/if.h b/lib/if.h
index 841ce51e..2116e12e 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -103,7 +103,13 @@ struct interface
/* Hardware address. */
#ifdef HAVE_STRUCT_SOCKADDR_DL
- struct sockaddr_dl sdl;
+ union {
+ /* note that sdl_storage is never accessed, it only exists to make space.
+ * all actual uses refer to sdl - but use sizeof(sdl_storage)! this fits
+ * best with C aliasing rules. */
+ struct sockaddr_dl sdl;
+ struct sockaddr_storage sdl_storage;
+ };
#else
unsigned short hw_type;
u_char hw_addr[INTERFACE_HWADDR_MAX];