ofp-util: Fix interpretation of NXFW_TUN_ID bit for NXFF_OPENFLOW10.
authorBen Pfaff <blp@nicira.com>
Tue, 23 Nov 2010 21:09:53 +0000 (13:09 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 25 Nov 2010 00:10:53 +0000 (16:10 -0800)
In NXFF_OPENFLOW10, the tun_id field is always supposed to be wildcarded.
That is what OVS used to do, but commit d8ae4d67 "flow: Fully separate
flow_wildcards from OpenFlow wildcard bits" broke it.

lib/ofp-util.c

index cc38105b57baa9f1c22a77316187b295bf47770e..d58f7ea5ce2627f4c4ba1ce36e5f23d7714d07bb 100644 (file)
@@ -124,7 +124,7 @@ ofputil_cls_rule_from_match(const struct ofp_match *match,
     wc->nw_src_mask = ofputil_wcbits_to_netmask(ofpfw >> OFPFW_NW_SRC_SHIFT);
     wc->nw_dst_mask = ofputil_wcbits_to_netmask(ofpfw >> OFPFW_NW_DST_SHIFT);
 
-    if (!(ofpfw & NXFW_TUN_ID)) {
+    if (flow_format == NXFF_TUN_ID_FROM_COOKIE && !(ofpfw & NXFW_TUN_ID)) {
         rule->flow.tun_id = htonl(ntohll(cookie) >> 32);
     } else {
         wc->wildcards |= FWW_TUN_ID;