From: Gregory Etelson Date: Wed, 6 Jul 2022 16:11:50 +0000 (+0300) Subject: app/testpmd: fix GTP PSC raw processing X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=a942222d56faf55b770a66be177590ed2d96584f;p=dpdk.git app/testpmd: fix GTP PSC raw processing Fix GTP PSP extension size initialization. Clear input buffer. Fixes: c65282c9aa31 ("app/testpmd: fix GTP PSC raw processing") Cc: stable@dpdk.org Signed-off-by: Gregory Etelson Acked-by: Aman Singh Reviewed-by: Andrew Rybchenko --- diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 6cb1173385..7f50028eb7 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -11030,10 +11030,12 @@ cmd_set_raw_parsed(const struct buffer *in) const struct rte_flow_item_gtp_psc *opt = item->spec; struct rte_gtp_psc_generic_hdr *hdr; - - *total_size += RTE_ALIGN(sizeof(hdr), + size_t hdr_size = RTE_ALIGN(sizeof(*hdr), sizeof(int32_t)); + + *total_size += hdr_size; hdr = (typeof(hdr))(data_tail - (*total_size)); + memset(hdr, 0, hdr_size); *hdr = opt->hdr; hdr->ext_hdr_len = 1; gtp_psc = i;