• Linus Lüssing's avatar
    batman-adv: bcast: remove remaining skb-copy calls · 808cfdfa
    Linus Lüssing authored
    We currently have two code paths for broadcast packets:
    
    A) self-generated, via batadv_interface_tx()->
       batadv_send_bcast_packet().
    B) received/forwarded, via batadv_recv_bcast_packet()->
       batadv_forw_bcast_packet().
    
    For A), self-generated broadcast packets:
    
    The only modifications to the skb data is the ethernet header which is
    added/pushed to the skb in
    batadv_send_broadcast_skb()->batadv_send_skb_packet(). However before
    doing so, batadv_skb_head_push() is called which calls skb_cow_head() to
    unshare the space for the to be pushed ethernet header. So for this
    case, it is safe to use skb clones.
    
    For B), received/forwarded packets:
    
    The same applies as in A) for the to be forwarded packets. Only the
    ethernet header is added. However after (queueing for) forwarding the
    packet in batadv_recv_bcast_packet()->batadv_forw_bcast_packet(), a
    packet is additionally decapsulated and is sent up the stack through
    batadv_recv_bcast_packet()->batadv_interface_...
    808cfdfa
send.c 34.1 KB