From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 310C0239 for ; Tue, 21 Nov 2017 14:20:30 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id DA67C20B90; Tue, 21 Nov 2017 08:20:29 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Tue, 21 Nov 2017 08:20:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=j2YrgkxtwpP9WVIJV eeTGV8InE+U+qm5z8CHD6xB/OI=; b=EdP9uv500FcldB8QN3QGh3j5kWW+1D7wj iinWkSgw8AxVFqSPouNTN7g5irI+FaNzqKWVRGBVeZXDSKjlmog3IiwULbz7Yt5K CR+cd2AYVfSyLEKvFbOdDpqwQxQY8EsuxIJrM0dsO5Zlpmtaw6gmfZzmbiXA1eKn JZMp1/IMbbiWxXRimvr/U5BS9/dThsDzpzfOVnglUa2LoNBrQoFDo++xiMfNCfcL zfhekeF3fXBjyAzWqOQiFjI36oYgADh5YtQF2gxlZIquxX8Cnx5/StoPmn5FNQ30 wcyZDjJf5aeYZi+mRPx2PaetIV47GodrGWisoqCnmVQ/kgXCALtsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=j2YrgkxtwpP9WVIJVeeTGV8InE+U+qm5z8CHD6xB/OI=; b=GzJadTin +wEf+qC/DW9I47G+WRTEhXTDMi0bU2UJ+XKsmlonofGwIhydSGaJCd/P+wHt09yH qJB+aAGVufJxoF7VBQvJrH0iclovwFdU/Xho4MVpXWs2AbnQSwSDrPOY/X0mxRmI NsVhtYeQ0JaTBdSZ8L+3qJFzUedPWmfNXmRoFfp43NniZbWIPxvaTVAsY7QxAPVW knGNBW2iEnBmAHPY8ieAJM9pbvePiMifJOOrfzeIE8sqf+Fb5e+kkuMS/9+0CEW5 2zwZELzqG1LOir05mipdd8TUQ0KJ/eiQwWkFknpsYbMdg5GJQtbX5frnTHld+oOn f+n9O9z9JZQm6A== X-ME-Sender: Received: from localhost.localdomain (unknown [180.158.62.0]) by mail.messagingengine.com (Postfix) with ESMTPA id A34F1243B9; Tue, 21 Nov 2017 08:20:25 -0500 (EST) From: Yuanhan Liu To: Matan Azrad Cc: Gaetan Rivet , dpdk stable Date: Tue, 21 Nov 2017 21:16:00 +0800 Message-Id: <1511270333-31002-18-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> References: <1511270333-31002-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/failsafe: fix parameters parsing' has been queued to stable release 17.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 13:20:30 -0000 Hi, FYI, your patch has been queued to stable release 17.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/24/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 3d2115da7360fc0cae912a745c266b2d0d691dbb Mon Sep 17 00:00:00 2001 From: Matan Azrad Date: Sun, 27 Aug 2017 10:23:14 +0300 Subject: [PATCH] net/failsafe: fix parameters parsing [ upstream commit 852be6520b0384a47bbf4f45fe62df01e165cf53 ] The corrupted code used wrongly snprintf return value as the number of characters actually copied, in spite of the meaning is the number of characters which would be generated for the given input. It caused to remain zerod bytes between the failsafe command line non sub device parameters indicates end of string. Hence, when rte_kvargs_parse tried to parse all parameters, it got end of string after the first one and the others weren't parsed. So, if the mac parameters was the first in command line it was taken while hotplug_poll was left default, and vice versa. The fix updates the buffer index by dedicated variable contains the copy size, by the way validates the comma separation. Fixes: a46f8d584eb8 ("net/failsafe: add fail-safe PMD") Signed-off-by: Matan Azrad Acked-by: Gaetan Rivet --- drivers/net/failsafe/failsafe_args.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/failsafe/failsafe_args.c b/drivers/net/failsafe/failsafe_args.c index 1f22416..ae857b0 100644 --- a/drivers/net/failsafe/failsafe_args.c +++ b/drivers/net/failsafe/failsafe_args.c @@ -286,10 +286,17 @@ fs_remove_sub_devices_definition(char params[DEVARGS_MAXLEN]) ERROR("Invalid parameter"); return -EINVAL; } - if (params[b] == ',' || params[b] == '\0') - i += snprintf(&buffer[i], b - a + 1, "%s", ¶ms[a]); - if (params[b] == '(') { + if (params[b] == ',' || params[b] == '\0') { + size_t len = b - a; + + if (i > 0) + len += 1; + snprintf(&buffer[i], len + 1, "%s%s", + i ? "," : "", ¶ms[a]); + i += len; + } else if (params[b] == '(') { size_t start = b; + b += closing_paren(¶ms[b]); if (b == start) return -EINVAL; @@ -393,6 +400,7 @@ failsafe_args_parse(struct rte_eth_dev *dev, const char *params) &dev->data->mac_addrs[0]); if (ret < 0) goto free_kvlist; + mac_from_arg = 1; } } -- 2.7.4