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 65B61A0487 for ; Wed, 3 Jul 2019 00:14:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2410E1BE4E; Wed, 3 Jul 2019 00:13:16 +0200 (CEST) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by dpdk.org (Postfix) with ESMTP id 8BC691BE21 for ; Wed, 3 Jul 2019 00:13:06 +0200 (CEST) Received: by mail-pg1-f176.google.com with SMTP id z75so84532pgz.5 for ; Tue, 02 Jul 2019 15:13:06 -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=4CfiP0PExkw4Vs3xMlc1LVPAlGrPbQ/hj++m20DmMLU=; b=ml8OdyCs0P9C8ouG+fA92xuEGG9XXVssclfDrq5LxP7e3/4fHf+Ubc8o7sbmQoZZ6b J+bd0+34IPt76/f590Og7LrUuHlguWi9jR4QC96DzpCciI41idYhKwKrsqa83FvPs1Ug C4vNvAPtCOjEyIfGwK2rcDlzStnb45ab2gBfrg5PpE/sbRYsJkbJZEgXulwzHf9UcvEq XAcnELrOuZEKRi7KJwM7aox5cZAZhcsm/UGPXReygg+EzGi5R3zNJ/BbYqXy5UaKCs8n HOWkaMPi4nKs/TOxBMJStXzp/7eakGdcF/+RB4cT9gHVwYfncyOM3+1RByr7ZvV3BdHJ Do2g== 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=4CfiP0PExkw4Vs3xMlc1LVPAlGrPbQ/hj++m20DmMLU=; b=nbzfFQTqvy2rwktf13YoVSmO943EDYvcXWgEINvFIw/P03/+jA1SLfrRVKlCuSETSx f3Jf9XNs8A3qeggntEZmGU52oaWSU3fmJ08VuyFPLu6HqCWc+yJcgcF7TNSqiycpdF19 ew4ZtZ9Lo9AT1g/HpZgUfBKu/x66IDxEls3aOr0gvKFuOJuRSiASIGPPT/2Eiz7kw8ES Kf3yJWmvOQ4UjGXmuF7hOIk3H7pbCohZ+PpDNpT1xNvmnjK7B322PjHpvQ+r9ey7eNzc 6Z6tYOpZKMRtriRakQgTGlaJ793FU0mbS1nYGKGIKjWqNuqKk9TH1tDMGIZ7bJteRJ2y yKtg== X-Gm-Message-State: APjAAAXUoOs5BKxaeepBlOXEsZm0GhvXqPHpI0A+uvhdb5v3vhkDCoDE /lCoSDAEP46QljbW+936gEyBos6IvaA= X-Google-Smtp-Source: APXvYqyhu0qCAB6ReVa5YiI91Jd0GxJ0YwTKpJLfGlYvk/NbjpesYHOGD7488sL83UcpPs/Cdid+bQ== X-Received: by 2002:a63:c0e:: with SMTP id b14mr32828801pgl.4.1562105585353; Tue, 02 Jul 2019 15:13:05 -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.04 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 15:13:04 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 2 Jul 2019 15:12:46 -0700 Message-Id: <20190702221247.28391-12-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 11/12] net/vdev_netvsc: use common ethernet address parsing 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/vdev_netvsc/vdev_netvsc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index 1fcf90d7bc02..be8f19c0c63e 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -529,15 +529,7 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface, } else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) { struct rte_ether_addr tmp; - if (sscanf(pair->value, - "%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":" - "%" SCNx8 ":%" SCNx8 ":%" SCNx8, - &tmp.addr_bytes[0], - &tmp.addr_bytes[1], - &tmp.addr_bytes[2], - &tmp.addr_bytes[3], - &tmp.addr_bytes[4], - &tmp.addr_bytes[5]) != 6) { + if (rte_ether_unformat_addr(pair->value, &tmp) != 0) { DRV_LOG(ERR, "invalid MAC address format" " \"%s\"", -- 2.20.1