skb_tunnel_info

skb_tunnel_info extracts tunnel info from sk_buff.

return value is ip_tunnel_info *

static inline struct ip_tunnel_info *
skb_tunnel_info(const struct sk_buff *skb)
{
	struct metadata_dst *md_dst = skb_metadata_dst(skb);
	struct dst_entry *dst;

	if (md_dst && md_dst->type == METADATA_IP_TUNNEL)
		return &md_dst->u.tun_info;

	dst = skb_dst(skb);
	if (dst && dst->lwtstate)
		return lwt_tun_info(dst->lwtstate);

	return NULL;
}
Publish At: Author:Aiden Leong

Read more posts by this author

comments powered by Disqus