From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 10ED8A0487 for ; Fri, 5 Jul 2019 19:18:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E39321BE62; Fri, 5 Jul 2019 19:16:55 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 4FE9B1BE31 for ; Fri, 5 Jul 2019 19:16:46 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id m9so1217528pls.8 for ; Fri, 05 Jul 2019 10:16:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uydbSbC2zGnRsZgvJFXp9jIPGPnX5Gw5KsKwpZZ65ME=; b=EhlaAIl9pzc0wslphhmLzkjhfuqIbkfCedKeUPmQRt3OLLnIH5M9wU0FogfPoUHAY3 49KICvBvnlP5x9VkQHa1DFcl8RzVtrnyJt8NFS/YjWnPztSbUUG7YdkQUaAc00tLaIWx 7qy+Dm1NrPYsGaHyPDZSfIBH/xZ+DzGgDT8/R083OKicD/xdKkEpIMtp9DCC2FMa2vgG bN6xJwcGf8o5+6mfC5j8pWZ5icxctEoc1nfyrJTPSUKYDxBF0XtwodNZ6nU52cYeTkqX pVn8KDRcPd6u8bh8W/EGRlxDWT/OfeCzMz4Yz5zm+wiSZ9glwJ2K2Dk5BJhnrlw1qyim GIMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uydbSbC2zGnRsZgvJFXp9jIPGPnX5Gw5KsKwpZZ65ME=; b=l34unhvo4VLJdX6PeD9jIwvfjvrME5K6pXxO7oqFMVxOIw7gK3z5EFl/5KdY5SkDnM ws+daiUIeLs122ODPwUnNkXwxckw3DrZM4oKQ1+/eV5xQYk6tlZN1+TpUoIyU/a0EnDl 37fO0AyZ7W4qg6JeFWlaLEI/XeiDCvTeKwhVbIrSraHEb0puOT53TeqxXneHkiQ0qRlr ukFFVRgK2s5vPyZYC+WzW9N/1ltjdzDr4xBgQnfagPigwaAUrGyJh+2wtQnvbMRymh4T qn+8qpHITQAbP9TBGH2OZQRDh0Nj2mMwJQimpPRZSg8F7y5Sk3iTxHq1w/NsmVwd6dks VHPg== X-Gm-Message-State: APjAAAXrtsUdJtYpMXJsmcYbEu5xQdGQecbqSnrNwWrmrIlFOaAvLNDt vOVH2m8H7VN4oov5FEp/b/HgGK1yX1Q= X-Google-Smtp-Source: APXvYqzX7Qe4Af49QXcXWFJfyD0Ruun3BORoXwI72rcGio2lnNihmQ7vplDwJ3lmqpoXGdR5QbZMnQ== X-Received: by 2002:a17:902:2006:: with SMTP id n6mr7007973pla.232.1562347005323; Fri, 05 Jul 2019 10:16:45 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 21sm8991014pjh.25.2019.07.05.10.16.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 05 Jul 2019 10:16:44 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Gaetan Rivet Date: Fri, 5 Jul 2019 10:16:24 -0700 Message-Id: <20190705171626.13448-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705171626.13448-1-stephen@networkplumber.org> References: <20190516180427.17270-1-stephen@networkplumber.org> <20190705171626.13448-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v8 09/11] net/failsafe: use common ether address parsing routine X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use rte_ether_unformat_addr rather than sscanf. Signed-off-by: Stephen Hemminger Acked-by: Gaetan Rivet --- drivers/net/failsafe/failsafe_args.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/failsafe/failsafe_args.c b/drivers/net/failsafe/failsafe_args.c index d2e725bcea13..707490b94c4e 100644 --- a/drivers/net/failsafe/failsafe_args.c +++ b/drivers/net/failsafe/failsafe_args.c @@ -368,15 +368,11 @@ fs_get_mac_addr_arg(const char *key __rte_unused, const char *value, void *out) { struct rte_ether_addr *ea = out; - int ret; if ((value == NULL) || (out == NULL)) return -EINVAL; - ret = sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - &ea->addr_bytes[0], &ea->addr_bytes[1], - &ea->addr_bytes[2], &ea->addr_bytes[3], - &ea->addr_bytes[4], &ea->addr_bytes[5]); - return ret != RTE_ETHER_ADDR_LEN; + + return rte_ether_unformat_addr(value, ea); } int -- 2.20.1