align mg_addr to 32- and 64-bits

This commit is contained in:
Sergio R. Caprile committed 2025-09-08 11:43:28 -03:00
1 parent df994df611
commit cc069e7e5d
5 files changed
+27 -29

No files matched your search

+5 -1
View File
@@ -14,7 +14,11 @@ struct mg_dns {
};
struct mg_addr {
uint8_t ip[16]; // Holds IPv4 or IPv6 address, in network byte order
union { // Holds IPv4 or IPv6 address, in network byte order
uint8_t ip[16];
uint32_t ip4;
uint64_t ip6[2];
};
uint16_t port; // TCP or UDP port in network byte order
uint8_t scope_id; // IPv6 scope ID
bool is_ip6; // True when address is IPv6 address