ip-packet: Fix removal of TFC padding for IPv6
The IPv6 length field denotes the payload length after the 40 bytes header.
Fixes: 293515f95c ("libipsec: remove extra RFC4303 TFC padding appended to inner payload")
This commit is contained in:
@@ -247,7 +247,7 @@ ip_packet_t *ip_packet_create(chunk_t packet)
|
|||||||
}
|
}
|
||||||
ip = (struct ip6_hdr*)packet.ptr;
|
ip = (struct ip6_hdr*)packet.ptr;
|
||||||
/* remove any RFC 4303 TFC extra padding */
|
/* remove any RFC 4303 TFC extra padding */
|
||||||
packet.len = min(packet.len, untoh16(&ip->ip6_plen));
|
packet.len = min(packet.len, 40 + untoh16(&ip->ip6_plen));
|
||||||
/* we only handle packets without extension headers, just skip the
|
/* we only handle packets without extension headers, just skip the
|
||||||
* basic IPv6 header */
|
* basic IPv6 header */
|
||||||
payload = chunk_skip(packet, 40);
|
payload = chunk_skip(packet, 40);
|
||||||
|
|||||||
Reference in New Issue
Block a user