summary refs log tree commit diff
path: root/src/core/platform/nmp-object.h
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2021-02-18 18:53:54 +0100
committerMichael Biebl <biebl@debian.org>2021-02-18 18:53:54 +0100
commit3a56bce6c0ea7ba0fe269520547740783b342e0d (patch)
tree9add44a08843f5ea53301716a0e8fde03a6536a7 /src/core/platform/nmp-object.h
parent80ec1decc49c72efec2a8b87c06245c92c0ab807 (diff)
New upstream version 1.30.0 upstream/1.30.0
Diffstat (limited to 'src/core/platform/nmp-object.h')
-rw-r--r--src/core/platform/nmp-object.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/platform/nmp-object.h b/src/core/platform/nmp-object.h
index dc2cc86b..19f6bcd7 100644
--- a/src/core/platform/nmp-object.h
+++ b/src/core/platform/nmp-object.h
@@ -34,10 +34,14 @@ typedef union {
     struct sockaddr_in6 in6;
 } NMSockAddrUnion;
 
+G_STATIC_ASSERT(sizeof(NMSockAddrUnion) == sizeof(((NMSockAddrUnion *) NULL)->in6));
+
+/* we initialize the largest union member, to ensure that all fields are initialized. */
+
 #define NM_SOCK_ADDR_UNION_INIT_UNSPEC \
     {                                  \
-        .sa = {                        \
-            .sa_family = AF_UNSPEC,    \
+        .in6 = {                       \
+            .sin6_family = AF_UNSPEC,  \
         },                             \
     }