team: add broadcast mode
Subsystems (2)
Hello Jiri Pirko,
The patch 5fc889911a99: "team: add broadcast mode" from Jul 11, 2012, leads to the following Smatch warning:drivers/net/team/team_mode_broadcast.c:46 bc_transmit()
warn: signedness bug returning '18446744073709551516'
The error message sucks because 18446744073709551516 is -100 as an int, and I'm not sure how it figures this returns -100...
But actually there is a signedness bug in bc_transmit(). We return error codes from team_dev_queue_xmit() and cast them to 1 as bool. This function is supposed to return 1 on success but instead it returns zero.
regards,
dan carpenter
Quoted 5 lines · Tue, Nov 20, 2012 at 08:23:07PM CET, [email protected] wrote:
Hello Jiri Pirko,
The patch
5fc889911a99: "team: add broadcast mode" from Jul 11, 2012, leads to the following Smatch warning:drivers/net/team/team_mode_broadcast.c:46bc_transmit()
Quoted 8 lines
warn: signedness bug returning '18446744073709551516'The error message sucks because 18446744073709551516 is -100 as an int, and I'm not sure how it figures this returns -100...
But actually there is a signedness bug in
bc_transmit(). We return error codes fromteam_dev_queue_xmit()and cast them to 1 as bool. This function is supposed to return 1 on success but instead it returns zero.
Thanks Dan for finding this. You are correct.
I'm going to send patch introducing "!" in front of both team_dev_queue_xmit() calls in bc_transmit(). That will correct this.
Jiri
Quoted 8 lines
regards,
dan carpenter--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html