mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
glib-aux: add NM_IN6ADDR_INIT() macro and use it
This commit is contained in:
parent
03bf4a3425
commit
c413d7c657
|
@ -25,6 +25,30 @@ typedef struct _NMIPAddr {
|
|||
.array = { 0 } \
|
||||
}
|
||||
|
||||
#define _NM_IN6ADDR_INIT(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af) \
|
||||
{ \
|
||||
.s6_addr = { \
|
||||
(a0), \
|
||||
(a1), \
|
||||
(a2), \
|
||||
(a3), \
|
||||
(a4), \
|
||||
(a5), \
|
||||
(a6), \
|
||||
(a7), \
|
||||
(a8), \
|
||||
(a9), \
|
||||
(aa), \
|
||||
(ab), \
|
||||
(ac), \
|
||||
(ad), \
|
||||
(ae), \
|
||||
(af), \
|
||||
} \
|
||||
}
|
||||
|
||||
#define NM_IN6ADDR_INIT(...) ((struct in6_addr) _NM_IN6ADDR_INIT(__VA_ARGS__))
|
||||
|
||||
extern const NMIPAddr nm_ip_addr_zero;
|
||||
|
||||
/* This doesn't really belong here, but since it's convenient to re-use nm_ip_addr_zero.ether_addr
|
||||
|
|
|
@ -4853,7 +4853,8 @@ nm_platform_ip_route_get_prune_list(NMPlatform *self,
|
|||
.table_coerced = nm_platform_route_table_coerce(local_table),
|
||||
.rt_pref = NM_ICMPV6_ROUTER_PREF_MEDIUM,
|
||||
.gateway = IN6ADDR_ANY_INIT,
|
||||
.network = {{{0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}},
|
||||
.network =
|
||||
NM_IN6ADDR_INIT(0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue