From 3a56bce6c0ea7ba0fe269520547740783b342e0d Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Thu, 18 Feb 2021 18:53:54 +0100 Subject: New upstream version 1.30.0 --- src/core/platform/nmp-object.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core/platform/nmp-object.h') 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, \ }, \ } -- cgit 1.3.0-6-gf8a5