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 B88F8A0487 for ; Fri, 5 Jul 2019 19:18:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68B001BE7B; Fri, 5 Jul 2019 19:16:59 +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 94FA81BE38 for ; Fri, 5 Jul 2019 19:16:48 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id u17so4090804pgi.6 for ; Fri, 05 Jul 2019 10:16:48 -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=d6q0jKiO15y39WrQggygBzL9oKWF/HaWpab1OOAzX5u0RzbotaugVD2prxlqSvs1R5 DekAgQ5rWjN/prRJQTdeaimJ0LrGLerwhas6XqYY+IWo5SUUFVXqYff7x3VQhzJ6rnVh 4wezaVdl9AkVIegxVWxPxNVrqsQUD9BYuEiRtR5CDQoAufLNtkZrYX1kqUpO1rbq6FIk jl318E1DWR+vCXD0HBPRpaJipcf8adOjqMwKf+Mrz2dU6pwbPIshDW+6OizhDjd6Kqc1 kHk4UVI63cMCbHYFqnV2D326R1Bm3Xf5IQEXqJPSzFJPczUx6JvRJrvBmEtRIEAYRjUP 6dJg== 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=t6WtRMVx9vHA0qTCS4ZEftRi1o9rUANM3I6Z+O5qGCNeb0DKAdHL5QzZ/IHnzIRBqU 2L7jxQjcu1TlX4w44lgrjWGdmlL/6jjgzlG0YPPZuWr+HEOFt20WFm1Gw7u2buL3R1Ex cxe7fcq5ulKeMQqFaIewRktpVv5BlBNXuIAWVPbH3/+K7UgLFo2sV4rpYLuyIauL9+mm 883RwVPHWlxgrT7Hl7vH5NY+SOLCp4A0CR4bRzeCUaMoS5BNK+6A39e5QW8baVLOvvfS mHfcTPll//mfWwMTKQ+XnxOojeaCNXV/o/AtDdcMyNx6jvO8GYw+yIG6j+thyYUk8oHW lU5w== X-Gm-Message-State: APjAAAUh73vUL04RGWsIgQfxeeQhCn3DCmyzwdNaxM4mjEYUAkDjXHXB hDALRB+8+1kuBc6gcUtJyAjV3ONlrww= X-Google-Smtp-Source: APXvYqwZzRfuWEMkPnfylx7Dv3q5RJ59LB+q4NbmPe0E96W7BLadmqcPMcr/eQu6aW4GiapH2MwNTA== X-Received: by 2002:a65:458d:: with SMTP id o13mr6638273pgq.34.1562347007472; Fri, 05 Jul 2019 10:16:47 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 21sm8991014pjh.25.2019.07.05.10.16.46 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 05 Jul 2019 10:16:46 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 5 Jul 2019 10:16:26 -0700 Message-Id: <20190705171626.13448-12-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705171626.13448-1-stephen@networkplumber.org> References: <20190516180427.17270-1-stephen@networkplumber.org> <20190705171626.13448-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v8 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