From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] net: fix inner L2 length in software ptype parser
Date: Mon, 11 Sep 2017 16:57:22 +0200 [thread overview]
Message-ID: <20170911145722.4833-1-olivier.matz@6wind.com> (raw)
The inner L2 length returned by rte_net_get_ptype() is not
properly initialized. If the caller does not zero the header
lengths structure, the inner_l2 field will be undefined.
Fix it by initializing inner_l2 to 0 when parsing a inner layer.
Fixes: 2c15c5377da2 ("net: support NVGRE in software packet type parser")
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
lib/librte_net/rte_net.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/librte_net/rte_net.c b/lib/librte_net/rte_net.c
index a8c7aff9c..a3ca04032 100644
--- a/lib/librte_net/rte_net.c
+++ b/lib/librte_net/rte_net.c
@@ -396,6 +396,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
if ((layers & RTE_PTYPE_INNER_L2_MASK) == 0)
return pkt_type;
+ hdr_lens->inner_l2_len = 0;
if (proto == rte_cpu_to_be_16(ETHER_TYPE_TEB)) {
eh = rte_pktmbuf_read(m, off, sizeof(*eh), &eh_copy);
if (unlikely(eh == NULL))
--
2.11.0
next reply other threads:[~2017-09-11 14:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 14:57 Olivier Matz [this message]
2017-10-05 21:33 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170911145722.4833-1-olivier.matz@6wind.com \
--to=olivier.matz@6wind.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).