DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] testpmd: Fix segment fault when port ID greater than 76
@ 2015-07-28 18:32 Michael Qiu
  2015-07-29 21:45 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Qiu @ 2015-07-28 18:32 UTC (permalink / raw)
  To: dev

In testpmd, when using "rx_vlan add 1 77", it will be a segment fault
Because the port ID should be less than 32.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
 app/test-pmd/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1d29146..cf2aa6e 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -388,7 +388,7 @@ port_id_is_invalid(portid_t port_id, enum print_warning warning)
 	if (port_id == (portid_t)RTE_PORT_ALL)
 		return 0;
 
-	if (ports[port_id].enabled)
+	if (port_id < RTE_MAX_ETHPORTS && ports[port_id].enabled)
 		return 0;
 
 	if (warning == ENABLED_WARN)
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH] testpmd: Fix segment fault when port ID greater than 76
  2015-07-28 18:32 [dpdk-dev] [PATCH] testpmd: Fix segment fault when port ID greater than 76 Michael Qiu
@ 2015-07-29 21:45 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-07-29 21:45 UTC (permalink / raw)
  To: Michael Qiu; +Cc: dev

2015-07-29 02:32, Michael Qiu:
> In testpmd, when using "rx_vlan add 1 77", it will be a segment fault
> Because the port ID should be less than 32.
> 
> Signed-off-by: Michael Qiu <michael.qiu@intel.com>

Fixes: edab33b1c01d ("app/testpmd: support port hotplug")

Applied, thanks

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

end of thread, other threads:[~2015-07-29 21:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28 18:32 [dpdk-dev] [PATCH] testpmd: Fix segment fault when port ID greater than 76 Michael Qiu
2015-07-29 21:45 ` Thomas Monjalon

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).