From: Ben Pfaff Date: Fri, 10 Jan 2014 23:14:27 +0000 (-0800) Subject: tunnel: Un-wildcard only flags that really exist in tnl_xlate_init(). X-Git-Tag: sliver-openvswitch-2.1.90-1~10^2~21 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=ad1aaa8b0318280a32f74e4bdf4ec2ff23d278bf;p=sliver-openvswitch.git tunnel: Un-wildcard only flags that really exist in tnl_xlate_init(). The revalidator code in ofproto-dpif-upcall.c, in revalidate_ukey(), deletes any datapath flow for which the kernel reports wildcarded bits that userspace requires to be matched. Until now, tnl_xlate_init() marked every bit in the tunnel flags as required to be matched. Since most of those bits don't actually have defined flags, adding such a flow to the datapath and then receiving it back caused those bits to become wildcarded, which meant that revalidate_ukey() always deleted them. This fixes the problem by only un-wildcarding defined flags. Reported-by: Guolin Yang Signed-off-by: Ben Pfaff --- diff --git a/ofproto/tunnel.c b/ofproto/tunnel.c index d55added7..09497a337 100644 --- a/ofproto/tunnel.c +++ b/ofproto/tunnel.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2013 Nicira, Inc. +/* Copyright (c) 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -273,6 +273,9 @@ tnl_xlate_init(const struct flow *base_flow, struct flow *flow, { if (tnl_port_should_receive(flow)) { memset(&wc->masks.tunnel, 0xff, sizeof wc->masks.tunnel); + wc->masks.tunnel.flags = (FLOW_TNL_F_DONT_FRAGMENT | + FLOW_TNL_F_CSUM | + FLOW_TNL_F_KEY); memset(&wc->masks.pkt_mark, 0xff, sizeof wc->masks.pkt_mark); if (!tnl_ecn_ok(base_flow, flow)) {