ip_frag: ensure minimum v6 fragmentation length
In addition, do a formal parameter check. Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
This commit is contained in:
parent
c2cad3f6bc
commit
cf5a605da6
@ -79,6 +79,15 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in,
|
|||||||
uint16_t fragment_offset, frag_size;
|
uint16_t fragment_offset, frag_size;
|
||||||
uint64_t frag_bytes_remaining;
|
uint64_t frag_bytes_remaining;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Formal parameter checking.
|
||||||
|
*/
|
||||||
|
if (unlikely(pkt_in == NULL) || unlikely(pkts_out == NULL) ||
|
||||||
|
unlikely(nb_pkts_out == 0) ||
|
||||||
|
unlikely(pool_direct == NULL) || unlikely(pool_indirect == NULL) ||
|
||||||
|
unlikely(mtu_size < RTE_IPV6_MIN_MTU))
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ensure the IP payload length of all fragments (except the
|
* Ensure the IP payload length of all fragments (except the
|
||||||
* the last fragment) are a multiple of 8 bytes per RFC2460.
|
* the last fragment) are a multiple of 8 bytes per RFC2460.
|
||||||
|
@ -371,6 +371,8 @@ struct rte_ipv6_hdr {
|
|||||||
#define RTE_IPV6_HDR_ECN_MASK (0x03 << RTE_IPV6_HDR_TC_SHIFT)
|
#define RTE_IPV6_HDR_ECN_MASK (0x03 << RTE_IPV6_HDR_TC_SHIFT)
|
||||||
#define RTE_IPV6_HDR_ECN_CE RTE_IPV6_HDR_ECN_MASK
|
#define RTE_IPV6_HDR_ECN_CE RTE_IPV6_HDR_ECN_MASK
|
||||||
|
|
||||||
|
#define RTE_IPV6_MIN_MTU 1280 /**< Minimum MTU for IPv6, see RFC 8200. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Process the pseudo-header checksum of an IPv6 header.
|
* Process the pseudo-header checksum of an IPv6 header.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user