Skip to contentSkip to conversation

batman-adv: Consider fragmentation for needed_headroom

PATCH In review Sven Eckelmann 1 participant 2 messages Nov 26, 2020 Batman advanced

lore
Share & tools
lore

Sven Eckelmann

author maintainer
#0 lore raw

PATCH 1/1 batman-adv: Consider fragmentation for needed_headroom

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 splitted.

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

---
 net/batman-adv/hard-interface.c | 3 +++
 1 file changed, 3 insertions(+)
net/batman-adv/hard-interface.c +3 -0
index f122e448..bbedb9a4 100644
@@ -553,6 +553,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;
 }
Signature · 1 line
2.29.2
author maintainer
#1 lore raw
Fixes e2b4301f4e2d ("batman-adv: Add lower layer needed_(head|tail)room to own ones")