From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 3CFFE1BB5A for ; Fri, 11 Jan 2019 21:35:30 +0100 (CET) Received: by mail-pl1-f196.google.com with SMTP id u18so7254774plq.7 for ; Fri, 11 Jan 2019 12:35:30 -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=q6E4bqIOc7KviUIwqKfcSHKj2Z1cMb3n3SO4KTMEIRY=; b=LfK4pNqa42oZskB2d7CmQxDWpxKKsN9/zmt2RnAx/FgSiK9zP/zYuo5sBu7+tSGdmS jK6O2G+eJkWMys5phaMfTJ1gNZMtMNl3HQitdf+4c/XoR2FsI82bmPf4YQCj4B8guCgH KjzcBcpiGGBzxuaswPYnGTkl69E72FMl51XjaOjjElt0RIaKwALDEp49GODelDoXJlmf sOrMynde5/dBWHMt3sGglVprr+rHKgsRqKkOw2A4LAyjm2D9EMzO8IwmMnm7GlUuRXQL 1F+JLvWV39swSqzW76ytHUs3JxKrWPKENfXHt6l5G+Qvlnc+bIwdOGd2AK3Hap5+m3Qm cPNg== 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=q6E4bqIOc7KviUIwqKfcSHKj2Z1cMb3n3SO4KTMEIRY=; b=ZgXJgJAxh5jpOblYkLB5zc5X0lIFycRIJCa74K71zrIhGVPI8H3nM6E9bWGIo6rUyf ecpHrublNPkELN94ZwV6mWW/YoRV9FlJH6y38AMiHQa8brd+S3zRhGh5fPnvvkLgu3Xq r0vsnQb0XsId6mOK5abhHbvoMWV4Qn0t/W3qaN73LGxM8DGnAf0wpFM6gHKkA7b6xpz5 Lr5zIHSLey6L4SGKetn1fr0d0d9V1X4fpaE/ovQ0PPoX+NjQvoYtNdLUU/rFRlZSKYRD dgLTKmpFh+TE3Zh0pN0d//7hz2chWIPJAvHfNx501mzP4D4EYVOR2re20eKAqhdJX3n+ 1Ucw== X-Gm-Message-State: AJcUukccXMTsSmI7ujM54EbHYFJ5yo0Y6WuQxjttvgvdDN+CRXxiLYzU av45P+0gzI0zDooQoXFWD0KufQ== X-Google-Smtp-Source: ALg8bN7BO6oOct0+b2kQOwOJXwjBHYmTR9tGhL0UY8lkQLuE1tTL/U+n5cA30TNq7wPGHAb2ZuY0Fw== X-Received: by 2002:a17:902:7044:: with SMTP id h4mr15883635plt.35.1547238929355; Fri, 11 Jan 2019 12:35:29 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id f32sm96610438pgf.80.2019.01.11.12.35.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Jan 2019 12:35:28 -0800 (PST) From: Stephen Hemminger To: keith.wiles@intel.com Cc: dev@dpdk.org, Stephen Hemminger Date: Fri, 11 Jan 2019 12:35:15 -0800 Message-Id: <20190111203520.19944-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111203520.19944-1-stephen@networkplumber.org> References: <20190111180659.5972-1-stephen@networkplumber.org> <20190111203520.19944-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 2/7] 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 20:35:30 -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 Acked-by Keith Wiles --- 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..11e402e42bd0 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, tap_unit - 1); return 0; } -- 2.20.1