ofp-util: Correct setting of Flow Mod cookie on encode
[openvswitch] / lib / meta-flow.c
index aa44ce8d52ede5ea39d638a79e5007585bca5142..591eb34447672c6e8671254f272d3e0553fc147b 100644 (file)
@@ -574,7 +574,7 @@ mf_is_all_wild(const struct mf_field *mf, const struct flow_wildcards *wc)
 {
     switch (mf->id) {
     case MFF_TUN_ID:
-        return !wc->masks.tun_id;
+        return !wc->masks.tunnel.tun_id;
     case MFF_METADATA:
         return !wc->masks.metadata;
     case MFF_IN_PORT:
@@ -671,7 +671,7 @@ mf_get_mask(const struct mf_field *mf, const struct flow_wildcards *wc,
 {
     switch (mf->id) {
     case MFF_TUN_ID:
-        mask->be64 = wc->masks.tun_id;
+        mask->be64 = wc->masks.tunnel.tun_id;
         break;
     case MFF_METADATA:
         mask->be64 = wc->masks.metadata;
@@ -952,7 +952,7 @@ mf_get_value(const struct mf_field *mf, const struct flow *flow,
 {
     switch (mf->id) {
     case MFF_TUN_ID:
-        value->be64 = flow->tun_id;
+        value->be64 = flow->tunnel.tun_id;
         break;
     case MFF_METADATA:
         value->be64 = flow->metadata;
@@ -1238,7 +1238,7 @@ mf_set_flow_value(const struct mf_field *mf,
 {
     switch (mf->id) {
     case MFF_TUN_ID:
-        flow->tun_id = value->be64;
+        flow->tunnel.tun_id = value->be64;
         break;
     case MFF_METADATA:
         flow->metadata = value->be64;
@@ -1941,7 +1941,8 @@ mf_from_ofp_port_string(const struct mf_field *mf, const char *s,
     uint16_t port;
 
     assert(mf->n_bytes == sizeof(ovs_be16));
-    if (ofputil_port_from_string(s, &port)) {
+    port = ofputil_port_from_string(s);
+    if (port) {
         *valuep = htons(port);
         *maskp = htons(UINT16_MAX);
         return NULL;