From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 3B5041BAFB for ; Fri, 11 Jan 2019 20:48:34 +0100 (CET) Received: by mail-pf1-f194.google.com with SMTP id g62so7399685pfd.12 for ; Fri, 11 Jan 2019 11:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y/xWUD2390MH7tmhmfKPwKAyJvfwzP0ViDCIuY/c8mA=; b=A0b9QzShIlk/uIy5Idn7SrJXo2yZRgo7pgvOntPondiMzKsmYiW8cG7XsOYXIkNghU 4kr9EoY9M40AGnHEOKNmYewkJCNNv7SAY2qWlbtVgTjX+hEtUaWsb2ocvk+d2CSGLoMG EoXVsBUe0txmoE//aSdswLBKcXHO2IPF8P5fL82Yx70aIZ19omMQ8BxQJm/YY0TT9bvL WZ3sUJU5FNXRiE7Fov6Xl+5DB+be4EPKaskZuZqBnLgJ3IZC9raJ1f17idexhJWCpR5f Co22wsjGxyYmA+C25Vn5LFfRHyXXCK6/xF9ROjEtmSxPUGHxojq8m1HDxs5m0VWJ8Ao6 mKPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y/xWUD2390MH7tmhmfKPwKAyJvfwzP0ViDCIuY/c8mA=; b=TgiZRQkBY1h2ULqlie79BPQCOSE4ptLA6/7u0aanNIz05XFVGW4F2LCaF/dYF71CXk RGPvnFu7B+jA8dDnXI+Smr4a6qwLHWs6xBC/9Xukuoe4tRVA9cxCpNGJevCAT2rUawA8 Pgc12gSTRQXwMw1AkA/ZEoWy3AJZqrgo/EZnX49KYt+1UI1C6LOuNQkRpGyFWhz47GTZ 6ZcyMAh0O/Zlvr2wZtpctOrtblUVbU8cCHCnSXePAGOTmoBuGUBclE2p0oBo4cpWVjOr ckGDZP3wVeAuHVdtSh4tN215CdtA15z0U/WZNxSRMpwT0Wy2sRy6Yu8ofj8lnIAInTYo /qhQ== X-Gm-Message-State: AJcUukdwEBZdSyl0OqdfiUsz1Xa2DkQi0ZlK4/D9UBAJWYBljfinUryL 9lCKqyc+bD/wezSeCmDWkuSU1g== X-Google-Smtp-Source: ALg8bN49i5gRJ4JOZdKj+JPUygGbG/3o+d1I7WKa8QKM00mWmsJ/11GI7aXE5fve1gnqDYsMdnBasw== X-Received: by 2002:a62:32c4:: with SMTP id y187mr16430983pfy.195.1547236113271; Fri, 11 Jan 2019 11:48:33 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id f13sm110649406pfa.132.2019.01.11.11.48.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 Jan 2019 11:48:33 -0800 (PST) Date: Fri, 11 Jan 2019 11:48:31 -0800 From: Stephen Hemminger To: "Wiles, Keith" Cc: "dev@dpdk.org" Message-ID: <20190111114831.04e12ba4@hermes.lan> In-Reply-To: <4AD48FCF-86CB-4C59-AF54-00850FA476D5@intel.com> References: <20190111180659.5972-1-stephen@networkplumber.org> <20190111180659.5972-3-stephen@networkplumber.org> <4AD48FCF-86CB-4C59-AF54-00850FA476D5@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [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 19:48:34 -0000 On Fri, 11 Jan 2019 19:32:39 +0000 "Wiles, Keith" wrote: > > On Jan 11, 2019, at 12:06 PM, Stephen Hemminger wrote: > > > > 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); > > Was this meant to change from tap_unit to tun_unit here, if so why? Accident. tun_unit disappears in later patch.