Skip to content

Commit

Permalink
Staging: batman-adv: Only clone skb data for multiple broadcasts
Browse files Browse the repository at this point in the history
batman-adv tries to resend broadcasts on all interfaces up to three
times. For each round and each interface it must provide a skb which
gets consumed by the sending function.

It is unnecessary to copy the data of each broadcast because the actual
data is either not shared or already copied by add_bcast_packet_to_list.
So it is enough to just copy the skb control data

Reported-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Sven Eckelmann authored and Greg Kroah-Hartman committed Sep 5, 2010
1 parent 99eed28 commit 43bfee7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/batman-adv/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ static void send_outstanding_bcast_packet(struct work_struct *work)
rcu_read_lock();
list_for_each_entry_rcu(batman_if, &if_list, list) {
/* send a copy of the saved skb */
skb1 = skb_copy(forw_packet->skb, GFP_ATOMIC);
skb1 = skb_clone(forw_packet->skb, GFP_ATOMIC);
if (skb1)
send_skb_packet(skb1,
batman_if, broadcast_addr);
Expand Down

0 comments on commit 43bfee7

Please sign in to comment.