ethdev: fix string length in name comparison
authorMohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Tue, 27 Feb 2018 08:58:27 +0000 (08:58 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 30 Mar 2018 12:08:43 +0000 (14:08 +0200)
commitb4572daa2c1056ba5a346841135747e8a2ea356e
treed2f509c581d3bfb2a64dd0de4644db8be37e4430
parent368b11185c8c35f95c6b4db1b24fa7757e5678f9
ethdev: fix string length in name comparison

The current code compares two strings upto the length of 1st string
(searched name). If the 1st string is prefix of 2nd string (existing name),
the string comparison returns the port_id of earliest prefix matches.
This patch fixes the bug by using strcmp instead of strncmp.

Fixes: 9c5b8d8b9fe ("ethdev: clean port id retrieval when attaching")
Cc: stable@dpdk.org
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/librte_ether/rte_ethdev.c