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>
uint16_t fragment_offset, frag_size;
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
* the last fragment) are a multiple of 8 bytes per RFC2460.
#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_MIN_MTU 1280 /**< Minimum MTU for IPv6, see RFC 8200. */
+
/**
* Process the pseudo-header checksum of an IPv6 header.
*