From: Stephen Hemminger <stephen@networkplumber.org>
To: Denis Sergeev <denserg.edu@gmail.com>
Cc: dev@dpdk.org, shepard.siegel@atomicrules.com,
ed.czeck@atomicrules.com, john.miller@atomicrules.com,
stable@dpdk.org
Subject: Re: [PATCH v2] net/ark: use standard IPv4 address parser
Date: Thu, 4 Jun 2026 09:55:29 -0700 [thread overview]
Message-ID: <20260604095529.0e9f7f04@phoenix.local> (raw)
In-Reply-To: <20260604034837.250221-1-denserg.edu@gmail.com>
On Thu, 4 Jun 2026 06:48:37 +0300
Denis Sergeev <denserg.edu@gmail.com> wrote:
> The IPv4 parsing helper used by pktgen and pktchkr read each octet with
> "%u", which accepts values above 255 from the configuration file and
> encodes them into unintended device register values.
>
> Replace the hand-rolled parser in both modules with inet_pton(), which
> validates the dotted-quad format and the octet range, and matches the
> IPv4 parsing already used by other DPDK drivers. For valid input the
> returned value is byte-order identical to the previous helper, so the
> register contents are unchanged.
>
> Fixes: 9c7188a68d7b ("net/ark: provide API for hardware modules pktchkr and pktgen")
> Cc: stable@dpdk.org
>
> Signed-off-by: Denis Sergeev <denserg.edu@gmail.com>
> ---
I think you need an additional header.
FAILED: drivers/libtmp_rte_net_ark.a.p/net_ark_ark_pktchkr.c.o
cc -Idrivers/libtmp_rte_net_ark.a.p -Idrivers -I../drivers -Idrivers/net/ark -I../drivers/net/ark -Ilib/ethdev -I../lib/ethdev -Ilib/eal/common -I../lib/eal/common -I. -I.. -Iconfig -I../config -Ilib/eal/include -I../lib/eal/include -Ilib/eal/freebsd/include -I../lib/eal/freebsd/include -Ilib/eal/x86/include -I../lib/eal/x86/include -Ilib/eal -I../lib/eal -Ilib/kvargs -I../lib/kvargs -Ilib/log -I../lib/log -Ilib/metrics -I../lib/metrics -Ilib/telemetry -I../lib/telemetry -Ilib/argparse -I../lib/argparse -Ilib/net -I../lib/net -Ilib/mbuf -I../lib/mbuf -Ilib/mempool -I../lib/mempool -Ilib/ring -I../lib/ring -Ilib/meter -I../lib/meter -Idrivers/bus/pci -I../drivers/bus/pci -I../drivers/bus/pci/bsd -Ilib/pci -I../lib/pci -Idrivers/bus/vdev -I../drivers/bus/vdev -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Werror -std=c11 -O3 -include rte_config.h -Wvla -Wcast-qual -Wcomma -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security -Wmissing-declar
ations -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings -Wno-missing-field-initializers -D_GNU_SOURCE -D__BSD_VISIBLE -fPIC -march=native -mrtm -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation -Wno-address-of-packed-member -DRTE_LOG_DEFAULT_LOGTYPE=pmd.net.ark -DRTE_ANNOTATE_LOCKS -Wthread-safety -MD -MQ drivers/libtmp_rte_net_ark.a.p/net_ark_ark_pktchkr.c.o -MF drivers/libtmp_rte_net_ark.a.p/net_ark_ark_pktchkr.c.o.d -o drivers/libtmp_rte_net_ark.a.p/net_ark_ark_pktchkr.c.o -c ../drivers/net/ark/ark_pktchkr.c
../drivers/net/ark/ark_pktchkr.c:381:16: error: use of undeclared identifier 'AF_INET'
381 | if (inet_pton(AF_INET, ip_address, &addr) != 1)
prev parent reply other threads:[~2026-06-04 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 5:47 [PATCH] net/ark: validate IPv4 octets in address parser Denis Sergeev
2026-06-03 17:29 ` Stephen Hemminger
2026-06-04 3:48 ` [PATCH v2] net/ark: use standard IPv4 " Denis Sergeev
2026-06-04 16:55 ` Stephen Hemminger [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=20260604095529.0e9f7f04@phoenix.local \
--to=stephen@networkplumber.org \
--cc=denserg.edu@gmail.com \
--cc=dev@dpdk.org \
--cc=ed.czeck@atomicrules.com \
--cc=john.miller@atomicrules.com \
--cc=shepard.siegel@atomicrules.com \
--cc=stable@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