From f6bbff4ef421b39d6d360d203cc473cd0641c7b9 Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Wed, 20 Jan 2016 21:17:45 -0800 Subject: [PATCH] datapath: compat: Add NULL check for tun-dst. tun-dst could be NULL in case of incorrect action list where set tunnel action is missing but packet is sent to tunnel vport. Signed-off-by: Pravin B Shelar Acked-by: Joe Stringer --- datapath/linux/compat/gso.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/datapath/linux/compat/gso.h b/datapath/linux/compat/gso.h index eb756ebe0..0f2b09a9a 100644 --- a/datapath/linux/compat/gso.h +++ b/datapath/linux/compat/gso.h @@ -170,7 +170,10 @@ static inline void ovs_skb_dst_set(struct sk_buff *skb, void *dst) static inline struct ip_tunnel_info *ovs_skb_tunnel_info(struct sk_buff *skb) { - return &OVS_GSO_CB(skb)->tun_dst->u.tun_info; + if (likely(OVS_GSO_CB(skb)->tun_dst)) + return &OVS_GSO_CB(skb)->tun_dst->u.tun_info; + else + return NULL; } static inline void ovs_skb_dst_drop(struct sk_buff *skb) -- 2.20.1