about 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:54:58 +0100
committerMichael Biebl <biebl@debian.org>2021-02-18 18:54:58 +0100
commiteca19fa2272137cfd38135376f8cbf6d0a2f2187 (patch)
tree36d3cdb47cd2b3b367dced642667479007ffaf62 /src/core/platform/nmp-object.h
parent16df93361dd8829fa730e08ce96650b499a59f70 (diff)
parent3a56bce6c0ea7ba0fe269520547740783b342e0d (diff)
Update upstream source from tag 'upstream/1.30.0'
Update to upstream version '1.30.0'
with Debian dir e4e3c5986af4d47930d9e35ac7d8bc6c70bd1dd9
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,  \
         },                             \
     }