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 E53DBA0487 for ; Wed, 3 Jul 2019 00:14:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 467F41BE5B; Wed, 3 Jul 2019 00:13:19 +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 C29CE1BE34 for ; Wed, 3 Jul 2019 00:13:07 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id w24so41628plp.2 for ; Tue, 02 Jul 2019 15:13:07 -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=ULTt3D4gCXrYYfqJplHvsin9lpEz0aBhn+tGWrDEVuB11rTYrC5OQjz1cxjO28GxVY gmWI4WJVUwMhsNu+k7s97UioZjffDo1HSds9P2uluPri+gDbxjk5J2hn0KWwz7UUZtFp z/LA3E1v6j4vnQvYAYZdWwX8gLFwZOGY/ToM8f0+s0PG5XIG66os41WKuZwy87OlynMd BEV2cFjm+wRzi6Q4VLxOz7G8t2rOlWb5Js9CtK2niRZpPKjRbyKvKIHN9KjY8K+/L+rM 8JHwIwlsFtxLn0lg8Jiay04lRYET0p1bVKcV8pDYascGMsajUTOttyK0OH9om+CTSUWe g5zw== 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=qCVhJWUqWagfZrdsoMrONiBC9BfO5kE5lsRW6Wu4KAVxRwEj26pB1/p1Am1BWUJaVD LancDXV/HgDwmJRMWmNhcS1BMWByA1fS4DGl+PjueGzmAXzzs/v9kIHcHG1YgNSYBpyA 18rxeesYdHeZMBc5fuKVuch5EDubslKMI7u3KVRcuelYKXK3TYIYJ/L0t2r+nIl9Zeg7 vwQcUg2+Ou7TawJVhsLEhCL49ihzJIJf3SM2fUF5qM9oIKo1Wt7dtIOoFEUtRnkxD/bz fdbYLHFmOS6D7cm3StP7lD3/sDZZb8+vB5OhxhEMsBHQQ3u1ZG5BSJ/IZs4s/IGCERtM JL+g== X-Gm-Message-State: APjAAAVkmjgagZB7RIGyBP99r6rY9qXDvF7woaQjDt043dmwO+k7hslA QDL9zvjw0hiMq7IvdaRstF68WW9c3KY= X-Google-Smtp-Source: APXvYqyiAgsb5xp2kwic5JvaWAdF05ygxYZMQaAust25AVCZH4GL0HPxWkt3jjPccZV0ZKstZLoI1g== X-Received: by 2002:a17:902:1129:: with SMTP id d38mr38330556pla.220.1562105586728; Tue, 02 Jul 2019 15:13:06 -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.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 15:13:05 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 2 Jul 2019 15:12:47 -0700 Message-Id: <20190702221247.28391-13-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 12/12] 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