DPDK patches and discussions
 help / color / mirror / Atom feed
From: Gur Stavi <gur.stavi@huawei.com>
To: 'Stephen Hemminger' <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, "John W. Linville" <linville@tuxdriver.com>,
	Ferruh Yigit <ferruh.yigit@amd.com>
Subject: RE: [PATCH v01] net/af_packet: add rollover and defrag options
Date: Wed, 30 Oct 2024 08:22:16 +0200	[thread overview]
Message-ID: <000f01db2a94$16d5ac30$44810490$@huawei.com> (raw)
In-Reply-To: <20241029194111.4d59987f@hermes.local>

> > +		if (strstr(pair->key, ETH_AF_PACKET_ROLLOVER) != NULL) {
> > +			rollover = atoi(pair->value);
> > +			if (rollover != 0 && rollover != 1) {
> > +				PMD_LOG(ERR,
> > +					"%s: invalid rollover value",
> > +				        name);
> > +				return -1;
> > +			}
> > +			continue;
> > +		}
> 
> The problem is that atoi() provides little to no error handling.
> Prefer using strtoul() and/or having a common routine for parsing flag
> values.

This block was copy-pasted from the handling of the other options.
I even copied by mistake the indentation error that checkpatch
complained about.

Do you want the atoi to be removed from the old code as well or just
from the new code?



      reply	other threads:[~2024-10-30  6:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 13:48 Gur Stavi
2024-10-29 16:09 ` Stephen Hemminger
2024-10-29 18:27   ` Gur Stavi
2024-10-30  2:41 ` Stephen Hemminger
2024-10-30  6:22   ` Gur Stavi [this message]

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='000f01db2a94$16d5ac30$44810490$@huawei.com' \
    --to=gur.stavi@huawei.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=linville@tuxdriver.com \
    --cc=stephen@networkplumber.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).