[dpdk-dev] [PATCH v4 2/3] ip_frag: ensure minimum v6 fragmentation length
Lukasz Wojciechowski
l.wojciechow at partner.samsung.com
Fri Apr 17 13:52:59 CEST 2020
W dniu 15.04.2020 o 19:25, Aaron Conole pisze:
> In addition, do a formal parameter check.
>
> Signed-off-by: Aaron Conole <aconole at redhat.com>
> ---
> lib/librte_ip_frag/rte_ipv6_fragmentation.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/lib/librte_ip_frag/rte_ipv6_fragmentation.c b/lib/librte_ip_frag/rte_ipv6_fragmentation.c
> index 43449970e5..ee984aed82 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 < 1280))
> + return -EINVAL;
> +
> /*
> * Ensure the IP payload length of all fragments (except the
> * the last fragment) are a multiple of 8 bytes per RFC2460.
Acked-by: Lukasz Wojciechowski <l.wojciechow at partner.samsung.com>
--
Lukasz Wojciechowski
Principal Software Engineer
Samsung R&D Institute Poland
Samsung Electronics
Office +48 22 377 88 25
l.wojciechow at partner.samsung.com
More information about the dev
mailing list