Skip to content

Commit

Permalink
batman-adv: bcast: avoid skb-copy for (re)queued broadcasts
Browse files Browse the repository at this point in the history
Broadcast packets send via batadv_send_outstanding_bcast_packet() were
originally copied in batadv_forw_bcast_packet_to_list() before being
queued. And after that only the ethernet header will be pushed through
batadv_send_broadcast_skb()->batadv_send_skb_packet() which works safely
on skb clones as it uses batadv_skb_head_push()->skb_cow_head().

Signed-off-by: Linus Lüssing <[email protected]>
Signed-off-by: Sven Eckelmann <[email protected]>
Signed-off-by: Simon Wunderlich <[email protected]>
  • Loading branch information
T-X authored and simonwunderlich committed May 17, 2021
1 parent 3f69339 commit 4cbf055
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/batman-adv/send.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ static void batadv_send_outstanding_bcast_packet(struct work_struct *work)
}

/* 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)
goto out;

Expand Down

0 comments on commit 4cbf055

Please sign in to comment.