X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_ip_frag%2Frte_ipv6_fragmentation.c;h=5d67336f2de398feb4ea3e8944dbfbc29b3b1553;hb=e863fe3a13da89787fdf3b5c590101a3c0f10af6;hp=43449970e5ace1b68d53054d310b5e4a51ef8380;hpb=4b06b0771f321bd4301075eaff64452261a45a4d;p=dpdk.git diff --git a/lib/librte_ip_frag/rte_ipv6_fragmentation.c b/lib/librte_ip_frag/rte_ipv6_fragmentation.c index 43449970e5..5d67336f2d 100644 --- a/lib/librte_ip_frag/rte_ipv6_fragmentation.c +++ b/lib/librte_ip_frag/rte_ipv6_fragmentation.c @@ -79,6 +79,15 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in, 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.