From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wiles, Keith" Subject: Re: [PATCH 2/6] net/tap: allow full length names Date: Fri, 11 Jan 2019 19:32:39 +0000 Message-ID: <4AD48FCF-86CB-4C59-AF54-00850FA476D5@intel.com> References: <20190111180659.5972-1-stephen@networkplumber.org> <20190111180659.5972-3-stephen@networkplumber.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: Stephen Hemminger Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4C99C1BAE6 for ; Fri, 11 Jan 2019 20:32:41 +0100 (CET) In-Reply-To: <20190111180659.5972-3-stephen@networkplumber.org> Content-Language: en-US Content-ID: <6B2B688E100BF94586961AE2D079AD41@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > On Jan 11, 2019, at 12:06 PM, Stephen Hemminger wrote: >=20 > The code for set_interface_name was incorrectly assuming that > space for null byte was necessary with snprintf/strlcpy. >=20 > 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(-) >=20 > 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 =3D (char *)extra_args; >=20 > 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? >=20 > return 0; > } > --=20 > 2.20.1 >=20 Regards, Keith