On Tue, 4 Dec 2018 16:26:05 -0800
Eric Dumazet [off-list ref] wrote:
quoted
+ /* skb_push() won't panic if we have room for the unaligned size
only */
+ BUG_ON(skb_headroom(skb) < hh_alen);
What about avoiding the panic and instead call kfree_skb() ?
if (WARN_ON_ONCE(skb_headroom(skb) < hh_alen)) {
kfree_skb(skb);
return NET_XMIT_DROP;
}
Okay, I guess it won't go unnoticed anyway, and it's probably better
than the alternative.
quoted
+
skb_push(skb, hh_len);
Maybe we can use __skb_push() here, since prior safety check should be
enough ?
Indeed, I'll change that in v2. Thanks!
--
Stefano