From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 85E8C45C0D; Wed, 30 Oct 2024 03:41:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60E6343003; Wed, 30 Oct 2024 03:41:16 +0100 (CET) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id 249C842EC5 for ; Wed, 30 Oct 2024 03:41:15 +0100 (CET) Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2e56750bb0dso4463094a91.0 for ; Tue, 29 Oct 2024 19:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1730256074; x=1730860874; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ZnyJYviiwLKInx7ud1WxdCC7QAWQEKyuFDEE7PiVF/8=; b=GuV6CqQe16+hV+UjbhVoFZRTYl4D0eDSD9eQd8JimtUXjzfqpTecYb+L6NUZqFB+16 c13Mc7Nlicxidmy4RC6jGBwhZntNbICbaQjsPCS2vihaIx4Hnp/OIuL/WcDt2l+d14eT iJv7evctJ8tSwW3Yvz6MO5P3GsTDc4NK61UiRWUL8BmCIkvD4lsg0j+h++3pkA3tBC9A c7Mb85kjmtisL8swH2pKzOZs/pCym2DK80qxTDM4G8jpVgLBcUfGraoQfUKbqsolUJOn osdwOXKCy8X4WD0nh7avcO+pZPJShJ4cUWN+N8CSZTtpwdQo7w+st5fPiYSdmN4QN14W MkZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730256074; x=1730860874; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZnyJYviiwLKInx7ud1WxdCC7QAWQEKyuFDEE7PiVF/8=; b=PFHVtGq/7bObXt7PK0kpDUxlSUHVgOvBB43Yxvjp1TehlX34rRbTXn96xdKafEK0Im qcX6rYg/t0uEejvK5yvZFS4d5Wjb9pvr5wFPDZ/ODMQGdWHEDjhB5qpF7d1KuJih5et8 I7MkwBdmuzxfYdXStLiuy2xLD/7/MKudOcXyYg+U5ZS9rFP8F1LIwdm20xlauNLntvlZ vK/rDZkoSw1ZWeH7DhEw3AY6MJFBxejm1fG09oaTjlojSjGydOqLSziMzJ2JibVwwQqT O1W7I+JxiG0QQRqP+75h9RWa4DiNgBgd21xkurkKzIYN944T2AxKDzWwSsmQUGXDhdVt nAIg== X-Gm-Message-State: AOJu0YzCKniEr/15d8fyrZVAK7xA4EfygxiVrQnz7n7RHeFmgBsfv84W J29HMvMVMCMmup0pEJy0atLHyEMtcPrsiC+bbmMe6T5kynLuBQLdKP0xCoIvkTQ= X-Google-Smtp-Source: AGHT+IFaWaJ67UXflSV7uA7Ph1yHzcGWcQ4ZFXd/RcE6qQyY1H+S67eXwWE7Yse95lbGBPx8KSUj/A== X-Received: by 2002:a17:90b:2741:b0:2e2:b64e:f506 with SMTP id 98e67ed59e1d1-2e8f105b461mr17490436a91.13.1730256074167; Tue, 29 Oct 2024 19:41:14 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e92fa20072sm440596a91.2.2024.10.29.19.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2024 19:41:13 -0700 (PDT) Date: Tue, 29 Oct 2024 19:41:11 -0700 From: Stephen Hemminger To: Gur Stavi Cc: , "John W. Linville" , Ferruh Yigit Subject: Re: [PATCH v01] net/af_packet: add rollover and defrag options Message-ID: <20241029194111.4d59987f@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, 29 Oct 2024 15:48:05 +0200 Gur Stavi 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.