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 2CC7DA0487 for ; Wed, 3 Jul 2019 00:14:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0635A1BE49; Wed, 3 Jul 2019 00:13:13 +0200 (CEST) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 4C76B1BE2B for ; Wed, 3 Jul 2019 00:13:05 +0200 (CEST) Received: by mail-pl1-f194.google.com with SMTP id 9so34480ple.5 for ; Tue, 02 Jul 2019 15:13:05 -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=3/kQl1j5SyxKKzbEezksBjCK+/0wdFo2ezqWlQlqQR4=; b=YFgGbP5NeZQGBpnoQvjKD7lBYqKQzpN7xc4v9rb42z2pLUzp9vf2dDApbbpw5lIEXW U1eDkQvNAmW9jeUVvGalTSbHMgKcurRU6BlD0x6aWZrkS5k++Gx0WL9ertEuOZqbRTbg cbaIbfd0JknP5b4zqFdzayai/wZ7t4MW/SjZ3gWrBwXSDU3jWx4KgtW8oHXezjt/HS+8 lX3qGYO9akn0HjdMUB0KkeTdgOVss26KD6RSXhjcbwtUwQbPDmKE1pDDMzqF+QF5Z0sV UF/c1wMcrEaPhqMvwwSPqcvEkoa3pmLuwfMQ4f9DarJmMbkmAncRglUGSmyhuXy03u97 dnHg== 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=3/kQl1j5SyxKKzbEezksBjCK+/0wdFo2ezqWlQlqQR4=; b=kTbZ+m0MUmIGOZ4yUCcfFJZbTLlLFzb4s4VPv82iHVK6g3q21hv7B0HrtkHFkOoRL6 D9r1Cy5BcjtXqyva+gyi6zose7wfWzoIcAN2c11OGiq5o6KVAPMk/NRTwhP85rX7EGey USp5lpH0uN1+lYbxNyF6yl2+MjUmlW92dgxPPimN3D/ihLbEUcLPifgvGGg4dDBXoquc 5bMZgMrLhvoxH6qiot22Nssbk+8mzy7aFbGu0QrlZnkXviXSFhZ/1tmNfKSvFI89Chva y4jivUVqRNewAIEV18b72BBV9fnZksPfDcpBttWj+D59so0EZCT/ZcE0Gya6zZgRXe5P Sahw== X-Gm-Message-State: APjAAAW+/eccM3opuijuDsUDoClGidq+eXOljCHzMR1LD7RNOzSnNzTj kFDhz0NryIF8hFR5xx/vIdNPtY836ng= X-Google-Smtp-Source: APXvYqwy3I5EcMohFPXLsQCSD9C7XmYZbKABs1wXhqShgxRaItsi6OdobPi56KmvLss9dN8PS3uwcw== X-Received: by 2002:a17:902:29a7:: with SMTP id h36mr38818423plb.158.1562105584190; Tue, 02 Jul 2019 15:13:04 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id q4sm25035pjq.27.2019.07.02.15.13.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 15:13:03 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 2 Jul 2019 15:12:45 -0700 Message-Id: <20190702221247.28391-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190702221247.28391-1-stephen@networkplumber.org> References: <20190516180427.17270-1-stephen@networkplumber.org> <20190702221247.28391-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v7 10/12] 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 --- 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