On Wed, Dec 14, 2016 at 03:50:38PM +0100, Sven Eckelmann wrote:
On Donnerstag, 6. Oktober 2016 08:41:40 CET Linus Lüssing wrote:
@@ -1842,8 +1844,12 @@ static int batadv_iv_ogm_receive(struct sk_buff *skb,
packet_pos = skb->data + ogm_offset; ogm_packet = (struct batadv_ogm_packet *)packet_pos;
skb_set_network_header(skb, ogm_offset); }
skb_reset_network_header(skb);
kfree_skb(skb); return NET_RX_SUCCESS;
}
Why must we skb_reset_network_header before the kfree?
Technically, yes, there's no need for it.
Usually I would have prefered keeping the skb network header pointer just after the ethernet header just like anything else on the receive path does right now. Would be messy if you could never be sure where that pointer actually points at.
On the other hand it was too convenient to use it here :).
What do you think about wrapping the WARN_ON, while loop and skb_reset_network_header() into a new function with a functional, non-modifying touch regarding the input skb?
Or do you think I should just remove the skb_reset_network_header() here?