platform: add NM_PLATFORM_IP[46]_ADDRESS_INIT() helper macros

This commit is contained in:
Thomas Haller 2020-09-18 12:25:23 +02:00
parent 6efd4e2efa
commit e232ce93d0
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -344,7 +344,7 @@ struct _NMPlatformIP4Address {
* addresses that only differ by their peer's network-part.
*
* Beware that for most cases, NetworkManager doesn't want to set an explicit
* peer-address. Hoever, that corresponds to setting the peer address to @address
* peer-address. However, that corresponds to setting the peer address to @address
* itself. Leaving peer-address unset/zero, means explicitly setting the peer
* address to 0.0.0.0, which you probably don't want.
* */
@ -377,6 +377,12 @@ typedef union {
#undef __NMPlatformIPAddress_COMMON
#define NM_PLATFORM_IP4_ADDRESS_INIT(...) \
(&((const NMPlatformIP4Address) { __VA_ARGS__ }))
#define NM_PLATFORM_IP6_ADDRESS_INIT(...) \
(&((const NMPlatformIP6Address) { __VA_ARGS__ }))
/* Default value for adding an IPv4 route. This is also what iproute2 does.
* Note that contrary to IPv6, you can add routes with metric 0 and it is even
* the default.