diff options
author | Thomas Haller <thaller@redhat.com> | 2019-01-13 13:31:15 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-01-22 16:30:23 +0100 |
commit | 744e11dc0d4b5d891942a8995386d7f09474d00b (patch) | |
tree | bb7cee6229105fe9e5a88c30f51e7a9e7c74389f | |
parent | 035c4ad45d75d4ac10c6da5b4138ecd55da6c5f8 (diff) | |
download | NetworkManager-744e11dc0d4b5d891942a8995386d7f09474d00b.tar.gz |
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.
-rw-r--r-- | shared/nm-utils/nm-shared-utils.h | 1 |
1 files changed, 1 insertions, 0 deletions
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. |