ip_frag: fix IPv6 fragment size calculation
PATCH 1/1 ip_frag: fix IPv6 fragment size calculation
Take into account IPv6 fragment extension header when calculating data size for each fragment.
Fixes 7a838c8798a9 ("ip_frag: fix IPv6 when MTU sizes not aligned to 8 bytes")
Fixes 0aa31d7a5929 ("ip_frag: add IPv6 fragmentation support")
Signed-off-by Konstantin Ananyev <[email protected]>
--- lib/librte_ip_frag/rte_ipv6_fragmentation.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
lib/librte_ip_frag/rte_ipv6_fragmentation.c +4 -2
@@ -83,8 +83,10 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in,* Ensure the IP payload length of all fragments (except the * the last fragment) are a multiple of 8 bytes per RFC2460. */ - frag_size =RTE_ALIGN_FLOOR (mtu_size -sizeof (struct rte_ipv6_hdr ), -RTE_IPV6_EHDR_FO_ALIGN ); + + frag_size = mtu_size -sizeof (struct rte_ipv6_hdr ) - +sizeof (struct ipv6_extension_fragment ); + frag_size =RTE_ALIGN_FLOOR (frag_size,RTE_IPV6_EHDR_FO_ALIGN );/* Check that pkts_out is big enough to hold all fragments */ if (unlikely (frag_size * nb_pkts_out <
Signature · 1 line
2.17.1
Thomas Monjalon
Applied06/06/2019 13:33, Konstantin Ananyev:
Quoted 8 lines
Take into account IPv6 fragment extension header when calculating data size for each fragment.
Fixes 7a838c8798a9 ("ip_frag: fix IPv6 when MTU sizes not aligned to 8 bytes")Fixes 0aa31d7a5929 ("ip_frag: add IPv6 fragmentation support")Signed-off-by Konstantin Ananyev <[email protected]>
Applied, thanks