From 744e11dc0d4b5d891942a8995386d7f09474d00b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 13 Jan 2019 13:31:15 +0100 Subject: [PATCH] shared: add "struct in_addr" union member to NMIPAddr struct NMIPAddr is a union of IPv4 and IPv6 addresses. A lot of our internal API handles IPv4 as in_addr_t / guint32 / be32_t types, as such the union field "addr4" is just a plain number. Possibly the internal API should be all refactored to prefer "struct in_addr" instead, but that is yet to be done. Anyway, at a few places we will need also access to the IPv4 address in form of a `struct in_addr`. Add an alias for that. I am not too happy about the resulting naming. It would be nicer to have struct in_addr addr4; struct in6_addr addr6; in_addr_t s_addr4; but for now, don't do such renaming. --- shared/nm-utils/nm-shared-utils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/nm-utils/nm-shared-utils.h b/shared/nm-utils/nm-shared-utils.h index 93868726e8..e28a5fb2f3 100644 --- a/shared/nm-utils/nm-shared-utils.h +++ b/shared/nm-utils/nm-shared-utils.h @@ -102,6 +102,7 @@ typedef struct { union { guint8 addr_ptr[1]; in_addr_t addr4; + struct in_addr addr4_struct; struct in6_addr addr6; /* NMIPAddr is really a union for IP addresses.