[2/7] batman-adv: Only clone skb data for multiple broadcasts

Message ID 1280697613-32001-3-git-send-email-sven.eckelmann@gmx.de
State Accepted, archived

Commit Message

Sven Eckelmann Aug. 1, 2010, 9:20 p.m. UTC
  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>
 batman-adv/send.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/batman-adv/send.c b/batman-adv/send.c
index fb0bfbf..524c0a9 100644
--- a/batman-adv/send.c
+++ b/batman-adv/send.c
@@ -477,7 +477,7 @@  static void send_outstanding_bcast_packet(struct work_struct *work)
 	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)
 				batman_if, broadcast_addr);