From 8cd5f33dd88b9e40a4fe37b539ecf4fae563c759 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 28 Aug 2019 09:53:19 +0200 Subject: [PATCH] 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. --- src/libipsec/ip_packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libipsec/ip_packet.c b/src/libipsec/ip_packet.c index fee70c195..f4f3358cc 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)) {