From fd304d9edb93aca4c089230e9c7bc27c4f6f9734 Mon Sep 17 00:00:00 2001 From: Rob Emery Date: Wed, 9 Oct 2024 22:14:31 +0100 Subject: [PATCH] Working around cast from 'struct sockaddr *' to 'struct sockaddr_in6 *' increases required alignment from 1 to 4 for BSD --- core/backends/lan/mdns.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/backends/lan/mdns.h b/core/backends/lan/mdns.h index bd9903eb1..82f602289 100644 --- a/core/backends/lan/mdns.h +++ b/core/backends/lan/mdns.h @@ -1085,10 +1085,10 @@ mdns_multiquery_send(int sock, const mdns_query_t* query, size_t count, void* bu socklen_t saddrlen = sizeof(addr_storage); if (getsockname(sock, saddr, &saddrlen) == 0) { if ((saddr->sa_family == AF_INET) && - (ntohs(((struct sockaddr_in*)saddr)->sin_port) == MDNS_PORT)) + (ntohs((reinterpret_cast(saddr))->sin_port) == MDNS_PORT)) rclass &= ~MDNS_UNICAST_RESPONSE; else if ((saddr->sa_family == AF_INET6) && - (ntohs(((struct sockaddr_in6*)saddr)->sin6_port) == MDNS_PORT)) + (ntohs((reinterpret_cast(saddr))->sin6_port) == MDNS_PORT)) rclass &= ~MDNS_UNICAST_RESPONSE; }