ERSPAN only support version 1 and 2. When packets send to an erspan device
which does not have proper version number set, drop the packet. In real
case, we observe multicast packets sent to the erspan pernet device,
erspan0, which does not have erspan version configured.
Without this patch, we observe warning message from ovs-vswitchd as below,
due to receive an malformed erspan packet:
odp_util|WARN|odp_tun_key_from_attr__ invalid erspan version
Reported-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
erspan_build_header(skb, ntohl(tunnel->parms.o_key),
tunnel->index,
truncate, true);
- else
+ else if (tunnel->erspan_ver == 2)
erspan_build_header_v2(skb, ntohl(tunnel->parms.o_key),
tunnel->dir, tunnel->hwid,
truncate, true);
+ else
+ goto free_skb;
tunnel->parms.o_flags &= ~TUNNEL_KEY;
__gre_xmit(skb, dev, &tunnel->parms.iph, htons(ETH_P_ERSPAN));