app/testpmd: fix GTP PSC extension header length
authorRaslan Darawsheh <rasland@nvidia.com>
Thu, 4 Nov 2021 09:40:25 +0000 (11:40 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Nov 2021 14:24:24 +0000 (15:24 +0100)
Current implementation for raw encap sets the length to be in bytes,
but, GTP 'extension' header length is an 8-bit field in 4-octet units.

This fixes the length calculation of the header length.

Fixes: 9213c50e36fa ("app/testpmd: support GTP PSC option in raw sets")
Cc: stable@dpdk.org
Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
Reviewed-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
app/test-pmd/cmdline_flow.c

index 0a22058..1b00ae5 100644 (file)
@@ -9213,7 +9213,7 @@ cmd_set_raw_parsed(const struct buffer *in)
                                        uint8_t qfi:6;
                                        uint8_t next;
                                } psc;
-                               psc.len = sizeof(psc);
+                               psc.len = sizeof(psc) / 4;
                                psc.pdu_type = opt->hdr.type;
                                psc.qfi = opt->hdr.qfi;
                                psc.next = 0;