On Wed, Sep 30, 2026 at 09:39:05PM +0300, Anton Danilov wrote:
quoted hunk ↗ jump to hunk
@@ -636,6 +641,12 @@ enum skb_drop_reason {
SKB_DROP_REASON_TUNNEL_OLD_SEQ,
/** @SKB_DROP_REASON_GRE_CSUM: GRE checksum error */
SKB_DROP_REASON_GRE_CSUM,
+ /**
+ * @SKB_DROP_REASON_TUNNEL_ENCAP: failed to build the encapsulation
+ * header of a tunnel, e.g. an unknown or unregistered encapsulation
+ * type.
+ */
+ SKB_DROP_REASON_TUNNEL_ENCAP,
/**
* @SKB_DROP_REASON_MAX: the maximum of core drop reasons, which
* shouldn't be used as a real 'reason' - only for tracing code gen
[...]
quoted hunk ↗ jump to hunk
@@ -620,8 +623,10 @@ void ip_md_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
if (!tunnel_hlen)
tunnel_hlen = ip_encap_hlen(&tun_info->encap);
- if (ip_tunnel_encap(skb, &tun_info->encap, &proto, &fl4) < 0)
+ if (ip_tunnel_encap(skb, &tun_info->encap, &proto, &fl4) < 0) {
+ reason = SKB_DROP_REASON_TUNNEL_ENCAP;
This will also cover the -ENOMEM from the callbacks, where
SKB_DROP_REASON_NOMEM is more appropriate. Better to change
ip_tunnel_encap() to return the appropriate drop reason like you did
with gre_parse_header().
quoted hunk ↗ jump to hunk
goto tx_error;
+ }
use_cache = ip_tunnel_dst_cache_usable(skb, tun_info);
if (use_cache)