Skip to content

Commit

Permalink
batman-adv: Consider fragmentation for needed_headroom
Browse files Browse the repository at this point in the history
If a batman-adv packets has to be fragmented, then the original batman-adv
packet header is not stripped away. Instead, only a new header is added in
front of the packet after it was split.

This size must be considered to avoid cost intensive reallocations during
the transmission through the various device layers.

Fixes: 7bca68c ("batman-adv: Add lower layer needed_(head|tail)room to own ones")
Reported-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
  • Loading branch information
Sven Eckelmann authored and Simon Wunderlich committed Nov 27, 2020
1 parent 14a2e55 commit 4ca23e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/batman-adv/hard-interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@ static void batadv_hardif_recalc_extra_skbroom(struct net_device *soft_iface)
needed_headroom = lower_headroom + (lower_header_len - ETH_HLEN);
needed_headroom += batadv_max_header_len();

/* fragmentation headers don't strip the unicast/... header */
needed_headroom += sizeof(struct batadv_frag_packet);

soft_iface->needed_headroom = needed_headroom;
soft_iface->needed_tailroom = lower_tailroom;
}
Expand Down

0 comments on commit 4ca23e2

Please sign in to comment.