Skip to content

Commit

Permalink
datapath: compat: Add NULL check for tun-dst.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Joe Stringer <[email protected]>
  • Loading branch information
pshelar committed Jan 21, 2016
1 parent 8d24e9c commit f6bbff4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion datapath/linux/compat/gso.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f6bbff4

Please sign in to comment.