mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 15:50:13 +01:00
platform: have union in NMPLinkAddress for NMEtherAddr
This commit is contained in:
parent
f74b7718b3
commit
1558e9a323
1 changed files with 8 additions and 1 deletions
|
|
@ -148,10 +148,17 @@ typedef enum {
|
|||
} NMPlatformRoutingRuleCmpType;
|
||||
|
||||
typedef struct {
|
||||
guint8 data[20 /* NM_UTILS_HWADDR_LEN_MAX */];
|
||||
union {
|
||||
guint8 data[20 /* NM_UTILS_HWADDR_LEN_MAX */];
|
||||
NMEtherAddr ether_addr;
|
||||
};
|
||||
guint8 len;
|
||||
} NMPLinkAddress;
|
||||
|
||||
/* assert that NMEtherAddr does not affect the alignment of NMPLinkAddress struct. */
|
||||
G_STATIC_ASSERT(_nm_alignof(NMEtherAddr) == 1);
|
||||
G_STATIC_ASSERT(_nm_alignof(NMPLinkAddress) == 1);
|
||||
|
||||
gconstpointer nmp_link_address_get(const NMPLinkAddress *addr, size_t *length);
|
||||
GBytes * nmp_link_address_get_as_bytes(const NMPLinkAddress *addr);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue