If the encap_dl_type is set then it indicates information about the dl_type of an encapsulated frame and should be used when decoding L3 and L4 information.
Signed-off-by: Simon Horman <ho...@verge.net.au> --- lib/packets.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/packets.c b/lib/packets.c index 59a6a61..844c0ec 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -976,8 +976,10 @@ packet_set_udp_port(struct ofpbuf *packet, ovs_be16 src, ovs_be16 dst) uint8_t packet_get_tcp_flags(const struct ofpbuf *packet, const struct flow *flow) { - if ((flow->dl_type == htons(ETH_TYPE_IP) || - flow->dl_type == htons(ETH_TYPE_IPV6)) && + ovs_be16 dl_type = flow->encap_dl_type + ? flow->encap_dl_type + : flow->dl_type; + if ((dl_type == htons(ETH_TYPE_IP) || dl_type == htons(ETH_TYPE_IPV6)) && flow->nw_proto == IPPROTO_TCP && packet->l7) { const struct tcp_header *tcp = packet->l4; return TCP_FLAGS(tcp->tcp_ctl); -- 1.7.10.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev