From: Sven Eckelmann Date: Sat, 20 Nov 2021 12:40:42 +0000 (+0100) Subject: batman-adv: Consider fragmentation for needed_headroom X-Git-Tag: v4.19.218~7 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=069e51e9a425851848aa5d2a937555a5f509ebc6;p=users%2Fdwmw2%2Flinux.git batman-adv: Consider fragmentation for needed_headroom commit 4ca23e2c2074465bff55ea14221175fecdf63c5f upstream. 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: 7bca68c7844b ("batman-adv: Add lower layer needed_(head|tail)room to own ones") Reported-by: Linus Lüssing Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/batman-adv/hard-interface.c b/net/batman-adv/hard-interface.c index c4e0435c952db..fc732b78daf77 100644 --- a/net/batman-adv/hard-interface.c +++ b/net/batman-adv/hard-interface.c @@ -565,6 +565,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; }