#include <rte_memcpy.h>
#include <rte_mempool.h>
#include <rte_debug.h>
+#include <rte_ether.h>
#include "ip_frag_common.h"
uint16_t fragment_offset, flag_offset, frag_size;
uint16_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_ETHER_MIN_MTU))
+ return -EINVAL;
+
/*
* Ensure the IP payload length of all fragments is aligned to a
* multiple of 8 bytes as per RFC791 section 2.3.
fragment_offset = (uint16_t)(fragment_offset +
out_pkt->pkt_len - sizeof(struct rte_ipv4_hdr));
- out_pkt->ol_flags |= PKT_TX_IP_CKSUM;
out_pkt->l3_len = sizeof(struct rte_ipv4_hdr);
/* Write the fragment to the output list */