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 8112EA00E6 for ; Mon, 8 Jul 2019 20:28:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0BFA11BE02; Mon, 8 Jul 2019 20:26:49 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id E8A141BD52 for ; Mon, 8 Jul 2019 20:26:35 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id g15so8109921pgi.4 for ; Mon, 08 Jul 2019 11:26:35 -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=zyCcY6Qyygvs3/n6ca08O0iKQEaNDeyO+DvEEksV450=; b=Hryng4AKmjKWnut+O8Xganr+WVZPIwdVhoDJ3SU6iu0G7kuh6VtgPjoeARv9JM9X2q nqZes+mclV9tQd5wnQbLpm8Vy4uQ8FIfTJxCyhOONcHCaqzq5hJ5bkfRy/uYRx8WC5Fg yfRIrHlr0r/7SMJkrndb5yfEL5IB0i7CEDejODYYLrU+8uPuLr7yByy04ZFObukZr0oW kPWYL9dw2Z1nMKgEbRO+vPV7pOWAHn46XA+UZ0K71E6CFPB3mGaRM+dC4HUlkDBNgqtv fNTaH4WqHY5AXS05Le/kKX/HLKtSA75oyh92QFUUeWH958PSH2gendPT666ukIX1QLI9 zPCw== 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=zyCcY6Qyygvs3/n6ca08O0iKQEaNDeyO+DvEEksV450=; b=fBexVqL3ao9akVy4AJGzJX+vG0QLifFDxKEsUgItYIscfarSmkStz1NPVFxPXh9gg/ lBkUv5qTQ9HATTNIVVRUIWLlwjjtaJSF07+MAaRdmJzIyDGjPf7O3FztG7uwbedmYwWO l2V/llvGULMwdHlkSThTtHjvAPGKNQgp9hxnIuCxzeHKZy+JOYAjs8yGVwT9RCK5+AeL pYU7AgF/qayt7SWxIdit9QmHEn7A3IlvdN5I0RUZW663lkvABbDuWAhSMnZ4XnxfgAjY 26fp/lA6QOKJ22Bh9JfKp6lJc/QKxT7EhNVtXFU1mH9OWTMu5Aa3SC6SPu2sAtS5nSZI 5hDA== X-Gm-Message-State: APjAAAW1OrbNdH4eUhnFPDDKPp3eA3/LwdyAqrwgg+7aaHCaONiUeJax coYowxXLtUMGlxCKHw0B2P5p3PCMfgA= X-Google-Smtp-Source: APXvYqy06AMgaec9crtHRhTYcrVAtpoFf19s1NoGzjTtAWDuYR5MfFAo6PA4BcET37+1X/VO42HDag== X-Received: by 2002:a63:5550:: with SMTP id f16mr12305552pgm.426.1562610394809; Mon, 08 Jul 2019 11:26:34 -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.33 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 11:26:33 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Matan Azrad Date: Mon, 8 Jul 2019 11:26:13 -0700 Message-Id: <20190708182614.1677-11-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 10/11] 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 Acked-by: Matan Azrad --- 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