[PATCH v4 2/9] app/test: fix typo in address compare

Bruce Richardson bruce.richardson at intel.com
Fri Nov 22 09:54:44 CET 2024


On Thu, Nov 21, 2024 at 10:23:23AM -0800, Stephen Hemminger wrote:
> The first argument of 'memcmp' function was equal to the second argument.
> Therefore ASSERT would always be true.
> 
> Link: https://pvs-studio.com/en/blog/posts/cpp/1179/
> 
> Fixes: 92073ef961ee ("bond: unit tests")
> Cc: declan.doherty at intel.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
>  app/test/test_link_bonding.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
> index 805613d7dd..b752a5ecbf 100644
> --- a/app/test/test_link_bonding.c
> +++ b/app/test/test_link_bonding.c
> @@ -792,7 +792,7 @@ test_set_primary_member(void)
>  				&read_mac_addr),
>  				"Failed to get mac address (port %d)",
>  				test_params->bonding_port_id);
> -		TEST_ASSERT_SUCCESS(memcmp(&read_mac_addr, &read_mac_addr,
> +		TEST_ASSERT_SUCCESS(memcmp(expected_mac_addr, &read_mac_addr,
>  				sizeof(read_mac_addr)),
>  				"bonding port mac address not set to that of primary port\n");
>

Acked-by: Bruce Richardson <bruce.richardson at intel.com>  


More information about the stable mailing list