diff options
author | Linus Lüssing <linus.luessing@c0d3.blue> | 2021-05-17 01:33:09 +0300 |
---|---|---|
committer | Simon Wunderlich <sw@simonwunderlich.de> | 2021-08-18 19:39:00 +0300 |
commit | 808cfdfad57999c85f9ab13499a38d136d032232 (patch) | |
tree | 37ab4e9bf83167901f8df30b5227c4bc4a96ca80 /net/batman-adv/routing.c | |
parent | 79a0bffb835a094e523c448295d27ccbe6ac6a9b (diff) | |
download | linux-808cfdfad57999c85f9ab13499a38d136d032232.tar.xz |
batman-adv: bcast: remove remaining skb-copy calls
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_rx().
Protocols higher up the stack are already required to check if the
packet is shared and create a copy for further modifications. When the
next (protocol) layer works correctly, it cannot happen that it tries to
operate on the data behind the skb clone which is still queued up for
forwarding.
Co-authored-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/routing.c')
0 files changed, 0 insertions, 0 deletions