From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id BFE0E1BA5D for ; Fri, 11 Jan 2019 19:07:10 +0100 (CET) Received: by mail-pg1-f194.google.com with SMTP id v28so6610237pgk.10 for ; Fri, 11 Jan 2019 10:07:10 -0800 (PST) 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=Nc8zRGyPtW/t+tplyof8ipbsovJluggymrj+iLyqHOU=; b=BpOpDKZvFe7K4Q1tNEVFEcbEvqCeDru/x3lTdDgnrZ8JsWa8uQLmDlemBrtyXA1HZc 3cZ/lM0sjEv41y26HSH8jFffKlVmNUkyIbLGqn8Isedt4/UrdF1ytm+2QveIcK++Rvyx 2hgQM7V2dRbqNr305cMo8LOV2SK5Rja2XnhHmvidj8XiS7SwmQupt+/WYtE9vk2rQ7ux fgVlmry6zABfSype0lU09EoSDKt6puRh0BDKahk4xftl2w9xmTffa1BCnalFuTD1b3DS tu30Fcy7CPt9d52etPmiDN2Q4wkbc/X3N+Q/sXX8Uc0Feg1tqgMtTfEIWm1kzjbt5CCI JgjQ== 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=Nc8zRGyPtW/t+tplyof8ipbsovJluggymrj+iLyqHOU=; b=t5jQI6kqO8QISRY9su+aQINs7mdsZ6GowlKHY5wl358nn7ZHsXk31iwlEpaE1DvbkS nfl4EUhiGJAVb0NvtHelP4ePluBJeup1d6f/lACem8AlZCwNptJObDTYN6Ergljtc0XB n/YMqQPIib6+s7BTjHgFO51zzUKSHyDFJiQWfF+8dX3wLlBGLPLE26zeK0g1lICwqKDh EeIhFujH2n5Mawk7y2uYhpxl5je+yrSPqxxZnk+DEKO7OSuicey2l2Djf1fW/bQwdQSt 8exemh+BLNUM8mfWO9ITc4bDjdH5qQ3QWto9BKP9yxZpgHsXatOisBuTLvhLfOIsZUbp rwPw== X-Gm-Message-State: AJcUukfBIx0yGU7GwgcetloghtS1mrfI0mey0vgo5bczhcUxjS1QHp+A UQOnUoC9ifLmzdZHz4aKzUyzjzC6ErE= X-Google-Smtp-Source: ALg8bN5cT5qJ2pPgt9LDU+PSorFUC8QvLFzvKcH0LJcLCaZyklyBZPXDHDqQQ14ozatH9ayFOjN62Q== X-Received: by 2002:a63:e74b:: with SMTP id j11mr7630092pgk.397.1547230029392; Fri, 11 Jan 2019 10:07:09 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id n186sm107213303pfn.137.2019.01.11.10.07.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jan 2019 10:07:08 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 11 Jan 2019 10:06:55 -0800 Message-Id: <20190111180659.5972-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111180659.5972-1-stephen@networkplumber.org> References: <20190111180659.5972-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/6] net/tap: allow full length names 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: , X-List-Received-Date: Fri, 11 Jan 2019 18:07:11 -0000 The code for set_interface_name was incorrectly assuming that space for null byte was necessary with snprintf/strlcpy. Fixes: 02f96a0a82d1 ("net/tap: add TUN/TAP device PMD") Signed-off-by: Stephen Hemminger --- drivers/net/tap/rte_eth_tap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 1c00681ba0eb..d7f77d664502 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1892,10 +1892,10 @@ set_interface_name(const char *key __rte_unused, char *name = (char *)extra_args; if (value) - strlcpy(name, value, RTE_ETH_NAME_MAX_LEN - 1); + strlcpy(name, value, RTE_ETH_NAME_MAX_LEN); else - snprintf(name, RTE_ETH_NAME_MAX_LEN - 1, "%s%d", - DEFAULT_TAP_NAME, (tap_unit - 1)); + snprintf(name, RTE_ETH_NAME_MAX_LEN, "%s%d", + DEFAULT_TAP_NAME, tun_unit - 1); return 0; } -- 2.20.1