[dpdk-dev] [PATCH 09/11] examples/ipsec-secgw: Fixed ip length in case of transport

Aviad Yehezkel aviadye at dev.mellanox.co.il
Sun Oct 15 14:56:05 CEST 2017



On 10/14/2017 4:28 PM, aviadye at dev.mellanox.co.il wrote:
> From: Aviad Yehezkel <aviadye at mellanox.com>
>
> IP length was incorrect causing corrupted ICMP packets for example
>
> Signed-off-by: Aviad Yehezkel <aviadye at mellanox.com>
> ---
>   examples/ipsec-secgw/esp.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/examples/ipsec-secgw/esp.c b/examples/ipsec-secgw/esp.c
> index 81ebf55..12c6f8c 100644
> --- a/examples/ipsec-secgw/esp.c
> +++ b/examples/ipsec-secgw/esp.c
> @@ -205,13 +205,13 @@ esp_inbound_post(struct rte_mbuf *m, struct ipsec_sa *sa,
>   		if (likely(ip->ip_v == IPVERSION)) {
>   			memmove(ip4, ip, ip->ip_hl * 4);
>   			ip4->ip_p = *nexthdr;
> -			ip4->ip_len = htons(rte_pktmbuf_data_len(m));
> +			ip4->ip_len = htons(rte_pktmbuf_pkt_len(m));
>   		} else {
>   			ip6 = (struct ip6_hdr *)ip4;
>   			/* XXX No option headers supported */
>   			memmove(ip6, ip, sizeof(struct ip6_hdr));
>   			ip6->ip6_nxt = *nexthdr;
> -			ip6->ip6_plen = htons(rte_pktmbuf_data_len(m));
> +			ip6->ip6_plen = htons(rte_pktmbuf_pkt_len(m));
>   		}
>   	} else
>   		ipip_inbound(m, sizeof(struct esp_hdr) + sa->iv_len);

Tested-by: Aviad Yehezkel <aviadye at mellanox.com>



More information about the dev mailing list