[PATCH v3 2/5] dumpcap: allow multiple invocations
Morten Brørup
mb at smartsharesystems.com
Thu Nov 9 08:50:10 CET 2023
> From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> Sent: Wednesday, 8 November 2023 19.36
>
> If dumpcap is run twice with each instance pointing a different
> interface, it would fail because of overlap in ring a pool names.
> Fix by putting process id in the name.
>
> Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
> Reported-by: Isaac Boukris <iboukris at gmail.com>
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
Minor detail: getpid() returns int, so prefer %d over %u.
[...]
> rte_exit(EXIT_FAILURE,
> "Packet dump enable on %u:%s failed %s\n",
> intf->port, intf->name,
> - rte_strerror(-ret));
> + rte_strerror(rte_errno));
This bugfix (the line above, not the patch itself) supports Tyler's proposal to standardize on returning -1 with rte_errno set on failure, instead of some functions returning -errno. Our dual convention for function return values will cause many bugs like this.
With %u or %d,
Reviewed-by: Morten Brørup <mb at smartsharesystems.com>
More information about the dev
mailing list