From: Olivier MATZ <olivier.matz@6wind.com>
To: Ilya Matveychikov <matvejchikov@gmail.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 1/2] mbuf: check sanity of data_len and pkt_len as well
Date: Fri, 1 Dec 2017 17:37:55 +0100 [thread overview]
Message-ID: <20171201163754.zhsd2uieqfhi6y7v@platinum> (raw)
In-Reply-To: <DEC79BD0-6A0F-453F-9E7E-0C7E3C9234BB@gmail.com>
Hi Ilya,
On Thu, Nov 16, 2017 at 06:04:43PM +0400, Ilya Matveychikov wrote:
> Signed-off-by: Ilya V. Matveychikov <matvejchikov@gmail.com>
Please, add a commit log.
> ---
> lib/librte_mbuf/rte_mbuf.c | 23 +++++++++++++++--------
> 1 file changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
> index 7543662f7..491685c36 100644
> --- a/lib/librte_mbuf/rte_mbuf.c
> +++ b/lib/librte_mbuf/rte_mbuf.c
> @@ -202,8 +202,7 @@ rte_pktmbuf_pool_create(const char *name, unsigned n,
> void
> rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
> {
> - const struct rte_mbuf *m_seg;
> - unsigned int nb_segs;
> + unsigned int nb_segs, pkt_len;
>
> if (m == NULL)
> rte_panic("mbuf is NULL\n");
> @@ -220,18 +219,26 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
> if ((cnt == 0) || (cnt == UINT16_MAX))
> rte_panic("bad ref cnt\n");
>
> + /* data_len supposed to be not more than pkt_len */
> + if (m->data_len > m->pkt_len)
> + rte_panic("bad data_len\n");
> +
This check should only be done if is_header == 1.
next prev parent reply other threads:[~2017-12-01 16:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 14:04 Ilya Matveychikov
2017-12-01 16:37 ` Olivier MATZ [this message]
2017-12-09 21:39 ` [dpdk-dev] [PATCH v2] " Ilya V. Matveychikov
2017-12-14 8:50 ` Olivier MATZ
2017-12-14 9:31 ` Olivier MATZ
2018-01-11 23:23 ` 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=20171201163754.zhsd2uieqfhi6y7v@platinum \
--to=olivier.matz@6wind.com \
--cc=dev@dpdk.org \
--cc=matvejchikov@gmail.com \
/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).