[PATCH v01] net/af_packet: add rollover and defrag options
Stephen Hemminger
stephen at networkplumber.org
Wed Oct 30 03:41:11 CET 2024
On Tue, 29 Oct 2024 15:48:05 +0200
Gur Stavi <gur.stavi at huawei.com> wrote:
> + 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.
More information about the dev
mailing list