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 CBA98A00E6 for ; Mon, 8 Jul 2019 20:28:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CBD7D1BDFC; Mon, 8 Jul 2019 20:26:47 +0200 (CEST) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 4F4BC1BD52 for ; Mon, 8 Jul 2019 20:26:34 +0200 (CEST) Received: by mail-pg1-f194.google.com with SMTP id w10so8100506pgj.7 for ; Mon, 08 Jul 2019 11:26:34 -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=s0ZVCv2B5VVqba29rTjxRECwRLAObGxJFrgwTsLWBkN1Muq7YAlpVAWJC3oadqzSKe lZ94Pv9stsEwGJPplMiL7oTNjOEG3uD293xALpzDWNt7J5PEt/dhjFq6u1IhGgAMxww4 BypyMB3NLqL4mfPIgNNeT471KZt8BYK8xlr/E2MI8iERpPHXQB1cjuS1OzTxubyHACi6 7Xp0In3VUG4aADMaKYG79jo4JQ1NYfyDRdoqd4pbV2PZnKLKlAsQNAe17PpN6hTgKlPd IyYpx5eA7uz7UuKhqNk0NpC1g/Nz9EcZEVFz4ySEd/p2ElNxM3RJ8/nYxVlwimTdtQuS TNFg== 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=FfY6sh8FSH7qbezGEfXhXykaFb2TA/fyoDHEupLwZD8frtwOCfd5ZWxHs1SIiZq0k8 cwQoRz4kJ/8EjfLD+57AHzq/pmTctj1N+Y2/XXOM+rD5Wp05Ylizf70/wD34C9TT4WfG VkD06X+eRW4W73hk3Hc5J4293t90jFDo3QbDQVeISUac+fyq9WHRj8Q3nrc5Z0FWI/Me +DfNmTG8wnqZPpzzsD5xCCFDOPYV3xLAsyxTDXlD7ftqwn8iYYNfHuUqt+efQ9BMQnhD wm8jfuLVZbmqAwAHysytBGz5R2sBF6WmnLN7/ay1NAsBc/fitwNw7dqfA3L7Eywh5G0+ gQqA== X-Gm-Message-State: APjAAAVtDzlPI7Jc7tExKpxVUEmj6jKvWSQF7S5WXAw4XV3B3sZqBsNB CXrV5/c1zErkhLLvXTrrdEA76UmlaOo= X-Google-Smtp-Source: APXvYqyNpoKu0NzO9KyMQDf6qg/NooMQzDbyfa9MFh//xsi0AYjLLU30BBkj7SowSfofsvMiugPBJA== X-Received: by 2002:a63:d847:: with SMTP id k7mr22722491pgj.283.1562610393178; Mon, 08 Jul 2019 11:26:33 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id o15sm18769295pgj.18.2019.07.08.11.26.31 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 11:26:31 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Gaetan Rivet Date: Mon, 8 Jul 2019 11:26:12 -0700 Message-Id: <20190708182614.1677-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190708182614.1677-1-stephen@networkplumber.org> References: <20190516180427.17270-1-stephen@networkplumber.org> <20190708182614.1677-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v9 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