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 A5E87A00E6 for ; Mon, 8 Jul 2019 20:28:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6D44E1BE08; Mon, 8 Jul 2019 20:26:50 +0200 (CEST) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id 0A9661BDE1 for ; Mon, 8 Jul 2019 20:26:37 +0200 (CEST) Received: by mail-pf1-f196.google.com with SMTP id u14so6812017pfn.2 for ; Mon, 08 Jul 2019 11:26:36 -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=LPaD72bknJnDwjBzFhvftEOmVauSwgLOU6kl7GVvQFA=; b=zW7uzWonv41O7vkRxbiURtpUxY1HlOXIj9E8UngBDx++Ee10ih8PT6Gw+OY5LCdnWY hOT7zlL+dOm8rUiyp9c/hQqaqYqFx45aUWRvRXHyAnWhu8kJBz3JtCHNQnCHlk7Ixb3t 9Nxb1pz/zjVDJjXbZmUCNideTlJp4mqFgL1dWA6pfFvWdIZT+JhAXAYmhsI4r4pnYS86 qgt15yLjICOUilUgORhUm8QOQiuj8SRemPBuAWap3E6Q/3kpcSXu98S8gPbMvYOsO568 kNX8EDLQ9ng2Khv710ohInBGWb6v4fGKxuTkXxd73eqNSbaNHjcMAn/9U+YG2njAH/gK DEqg== 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=LPaD72bknJnDwjBzFhvftEOmVauSwgLOU6kl7GVvQFA=; b=aHnNNDJ/QSQ7LKV3q1ikxejd3v8OgUBckZ3Uh2R2f19dt62qWIv+fXSSsD2BPGJJkc //jQsUi1yvuakYpfaaMv3nNKjBDFxLmIAV13phqRPd80xWo4iE+UiFAAEy1RfdrKhhGK WOMzz1I3QxpeEyhpS4Z23Mg1da+4LSSstn/111Tad+ofmBLyXW3UX/NAuypy9Om/g/cF HraINjZkoBH2dw6ejmq1AnVhjfcMoxcRsb+TtTiDSoEQ+yZKH1HTNXapR7I2a8Q6/mmt UqILu+pxpyx916Po3sDNCms5ZdmTesTZU1OkDVLX9Z0u2kG1NDx33uK9RtoP70lxKk8u yvTA== X-Gm-Message-State: APjAAAVMWqBYpDKLiPpJ4x2oq+zVKg97DD8h4RzpxSQPqJDB6uGJp9oI 41FhrQhZIj2Lg3pVLtvJEM2BfKU4f6U= X-Google-Smtp-Source: APXvYqxHH+CGeVfxLETQgxlamqhRE4FpBPneANjYxdPiJK0kbBe736HgVtn9YaJob8DiCpam/ePSwQ== X-Received: by 2002:a63:6cc3:: with SMTP id h186mr25125052pgc.292.1562610395938; Mon, 08 Jul 2019 11:26:35 -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.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 11:26:35 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 8 Jul 2019 11:26:14 -0700 Message-Id: <20190708182614.1677-12-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 11/11] net/memif: use common ethernet 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/memif/rte_eth_memif.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c index e9ddf6413597..00c9b396ab85 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c @@ -1224,13 +1224,8 @@ static int memif_set_mac(const char *key __rte_unused, const char *value, void *extra_args) { struct rte_ether_addr *ether_addr = (struct rte_ether_addr *)extra_args; - int ret = 0; - ret = sscanf(value, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", - ðer_addr->addr_bytes[0], ðer_addr->addr_bytes[1], - ðer_addr->addr_bytes[2], ðer_addr->addr_bytes[3], - ðer_addr->addr_bytes[4], ðer_addr->addr_bytes[5]); - if (ret != 6) + if (rte_ether_unformat_addr(value, ether_addr) < 0) MIF_LOG(WARNING, "Failed to parse mac '%s'.", value); return 0; } -- 2.20.1