X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fofp-util.c;h=99ef722332830726405f2b197ae509a7ba8d4f9a;hb=772ec52b896380f23b587bea4a5bf18edd22449d;hp=cc38105b57baa9f1c22a77316187b295bf47770e;hpb=66642cb40b12594c62f3d3037f1e4efa528416b7;p=openvswitch diff --git a/lib/ofp-util.c b/lib/ofp-util.c index cc38105b..99ef7223 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -103,7 +103,8 @@ enum { * wildcarded. */ void ofputil_cls_rule_from_match(const struct ofp_match *match, - unsigned int priority, int flow_format, + unsigned int priority, + enum nx_flow_format flow_format, uint64_t cookie, struct cls_rule *rule) { struct flow_wildcards *wc = &rule->wc; @@ -124,7 +125,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; @@ -205,7 +206,8 @@ ofputil_cls_rule_from_match(const struct ofp_match *match, * the latter case only, 'match''s NXFW_TUN_ID bit will be filled in; otherwise * it is always set to 0. */ void -ofputil_cls_rule_to_match(const struct cls_rule *rule, int flow_format, +ofputil_cls_rule_to_match(const struct cls_rule *rule, + enum nx_flow_format flow_format, struct ofp_match *match) { const struct flow_wildcards *wc = &rule->wc;