8d4d3a4f73
The rte_ipv4_fragment_packet API expects that the link/interface MTU value passed in be divisible by 8 bytes. Given the name of the parameter is "mtu" rather than "frag_size" it is not necessarily the case that it will be divisible by 8. An MTU of 1500 happens to produce a max fragment size of 1480 (1500 - sizeof(ipv4_hdr)) which is divisible by 8 but other MTU values such as 1600 or 9000 do not produce values that are divisible by 8. Unfortunately, the API checks that the frag_size value produced is divisible by 8 with a call to RTE_ASSERT which is only enabled when the RTE_LOG_LEVEL >= RTE_LOG_DEBUG. In cases where the log level is set normally the code silently continues and produces IP fragments that have invalid fragment offset values. An application may not have control over what MTU a user selects and rather than have each application adjust the MTU to pass a suitable value to the fragmentation API this change modifies the fragmentation API to handle cases where the "mtu" argument is not divisible by 8 and automatically adjust the internal "frag_size". Signed-off-by: Allain Legacy <allain.legacy@windriver.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> |
||
---|---|---|
.. | ||
ip_frag_common.h | ||
ip_frag_internal.c | ||
Makefile | ||
rte_ip_frag_common.c | ||
rte_ip_frag.h | ||
rte_ipfrag_version.map | ||
rte_ipv4_fragmentation.c | ||
rte_ipv4_reassembly.c | ||
rte_ipv6_fragmentation.c | ||
rte_ipv6_reassembly.c |