DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: fix memory access error for metering CLI
@ 2017-10-27  9:17 Jasvinder Singh
  2017-11-07  6:29 ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Jasvinder Singh @ 2017-10-27  9:17 UTC (permalink / raw)
  To: dev; +Cc: john.mcnamara

Fix memory access (out of bounds write) error, color and
action assignments.

Coverity issue: 198437
Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
 app/test-pmd/cmdline_mtr.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/cmdline_mtr.c b/app/test-pmd/cmdline_mtr.c
index 82b0ddf..d8d806d 100644
--- a/app/test-pmd/cmdline_mtr.c
+++ b/app/test-pmd/cmdline_mtr.c
@@ -802,17 +802,15 @@ static void cmd_set_port_meter_policer_action_parsed(void *parsed_result,
 		color = RTE_MTR_GREEN;
 	else if (strcmp(c, "Y") == 0)
 		color = RTE_MTR_YELLOW;
-	else if (strcmp(c, "Y") == 0)
-		color = RTE_MTR_RED;
 	else
-		color = RTE_MTR_COLORS;
+		color = RTE_MTR_RED;
 
 	/* Action */
 	if (strcmp(a, "G") == 0)
 		action[color] = MTR_POLICER_ACTION_COLOR_GREEN;
 	else if (strcmp(a, "Y") == 0)
 		action[color] = MTR_POLICER_ACTION_COLOR_YELLOW;
-	else if (strcmp(a, "Y") == 0)
+	else if (strcmp(a, "R") == 0)
 		action[color] = MTR_POLICER_ACTION_COLOR_RED;
 	else
 		action[color] = MTR_POLICER_ACTION_DROP;
-- 
2.9.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix memory access error for metering CLI
  2017-10-27  9:17 [dpdk-dev] [PATCH] app/testpmd: fix memory access error for metering CLI Jasvinder Singh
@ 2017-11-07  6:29 ` Ferruh Yigit
  2017-11-07  6:31   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2017-11-07  6:29 UTC (permalink / raw)
  To: Jasvinder Singh, dev; +Cc: john.mcnamara

On 10/27/2017 2:17 AM, Jasvinder Singh wrote:
> Fix memory access (out of bounds write) error, color and
> action assignments.
> 
> Coverity issue: 198437
> Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix memory access error for metering CLI
  2017-11-07  6:29 ` Ferruh Yigit
@ 2017-11-07  6:31   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-11-07  6:31 UTC (permalink / raw)
  To: Jasvinder Singh, dev; +Cc: john.mcnamara

On 11/6/2017 10:29 PM, Ferruh Yigit wrote:
> On 10/27/2017 2:17 AM, Jasvinder Singh wrote:
>> Fix memory access (out of bounds write) error, color and
>> action assignments.
>>
>> Coverity issue: 198437
>> Fixes: 30ffb4e67ee3 ("app/testpmd: add commands traffic metering and policing")
>>
>> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-07  6:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-27  9:17 [dpdk-dev] [PATCH] app/testpmd: fix memory access error for metering CLI Jasvinder Singh
2017-11-07  6:29 ` Ferruh Yigit
2017-11-07  6:31   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).