ip-packet: Fix compiler warning seen on FreeBSD 15

We explicitly use untoh16() so this warning isn't relevant:

  ip_packet.c:313:42: error: taking address of packed member 'ip_len' of class or structure 'ip' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
This commit is contained in:
Tobias Brunner
2025-12-12 15:58:31 +01:00
parent db6eca56d7
commit 9d242a4f7d
+1 -1
View File
@@ -310,7 +310,7 @@ ip_packet_t *ip_packet_create(chunk_t packet)
}
ip = (struct ip*)packet.ptr;
/* remove any RFC 4303 TFC extra padding */
packet.len = min(packet.len, untoh16(&ip->ip_len));
packet.len = min(packet.len, untoh16((void*)&ip->ip_len));
payload = chunk_skip(packet, ip->ip_hl * 4);
if ((ip->ip_off & htons(IP_OFFMASK)) == 0 &&
!parse_transport_header(payload, ip->ip_p, &sport, &dport))