Skip to content

Commit

Permalink
team: bcast: convert return value of team_dev_queue_xmit() to bool co…
Browse files Browse the repository at this point in the history
…rrectly

The thing is that team_dev_queue_xmit() returns NET_XMIT_* or -E*.
bc_trasmit() should return true in case all went well. So use ! to get
correct retval from team_dev_queue_xmit() result.
This bug caused iface statistics to be badly computed.

This bug was introduced by:
team: add broadcast mode (5fc8899)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Nov 21, 2012
1 parent 0e376bd commit 403f43c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/team/team_mode_broadcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb)
if (last) {
skb2 = skb_clone(skb, GFP_ATOMIC);
if (skb2) {
ret = team_dev_queue_xmit(team, last,
skb2);
ret = !team_dev_queue_xmit(team, last,
skb2);
if (!sum_ret)
sum_ret = ret;
}
Expand All @@ -39,7 +39,7 @@ static bool bc_transmit(struct team *team, struct sk_buff *skb)
}
}
if (last) {
ret = team_dev_queue_xmit(team, last, skb);
ret = !team_dev_queue_xmit(team, last, skb);
if (!sum_ret)
sum_ret = ret;
}
Expand Down

0 comments on commit 403f43c

Please sign in to comment.