Skip to contentSkip to conversation

team: add broadcast mode

DISCUSSION Dan Carpenter 2 participants 2 messages Nov 20, 2012 – Nov 21, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
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:46 bc_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 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.

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