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:
@@ -310,7 +310,7 @@ ip_packet_t *ip_packet_create(chunk_t packet)
|
|||||||
}
|
}
|
||||||
ip = (struct ip*)packet.ptr;
|
ip = (struct ip*)packet.ptr;
|
||||||
/* remove any RFC 4303 TFC extra padding */
|
/* 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);
|
payload = chunk_skip(packet, ip->ip_hl * 4);
|
||||||
if ((ip->ip_off & htons(IP_OFFMASK)) == 0 &&
|
if ((ip->ip_off & htons(IP_OFFMASK)) == 0 &&
|
||||||
!parse_transport_header(payload, ip->ip_p, &sport, &dport))
|
!parse_transport_header(payload, ip->ip_p, &sport, &dport))
|
||||||
|
|||||||
Reference in New Issue
Block a user