From: Tobias Brunner Date: Wed, 28 Aug 2019 07:53:19 +0000 (+0200) Subject: libipsec: Fix compiler warning with GCC 9 X-Git-Tag: 5.8.1rc2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cd5f33dd88b9e40a4fe37b539ecf4fae563c759;p=thirdparty%2Fstrongswan.git libipsec: Fix compiler warning with GCC 9 The compiler complains that "taking address of packed member ... of class or structure 'ip6_hdr' may result in an unaligned pointer value". We don't care if the address is aligned as we explicitly use untoh16() to convert the read value. --- diff --git a/src/libipsec/ip_packet.c b/src/libipsec/ip_packet.c index fee70c1954..f4f3358cc0 100644 --- a/src/libipsec/ip_packet.c +++ b/src/libipsec/ip_packet.c @@ -335,7 +335,7 @@ ip_packet_t *ip_packet_create(chunk_t packet) } ip = (struct ip6_hdr*)packet.ptr; /* remove any RFC 4303 TFC extra padding */ - packet.len = min(packet.len, 40 + untoh16(&ip->ip6_plen)); + packet.len = min(packet.len, 40 + untoh16((void*)&ip->ip6_plen)); if (!parse_transport_header_v6(ip, packet, &payload, &next_header, &sport, &dport)) {