]> git.proxmox.com Git - mirror_ovs.git/blobdiff - lib/ofp-packet.c
ofp-ed-props: Fix using uninitialized padding for NSH encap actions.
[mirror_ovs.git] / lib / ofp-packet.c
index a1ffe17de5f615dacd266ebd338ea33d689bfb5a..4579548ee174e61da5b3f2dbcd0c98f060d094d7 100644 (file)
@@ -420,6 +420,7 @@ enum nx_continuation_prop_type {
     NXCPT_COOKIE,
     NXCPT_ACTIONS,
     NXCPT_ACTION_SET,
+    NXCPT_ODP_PORT,
 };
 
 /* Only NXT_PACKET_IN2 (not NXT_RESUME) should include NXCPT_USERDATA, so this
@@ -506,6 +507,10 @@ ofputil_put_packet_in_private(const struct ofputil_packet_in_private *pin,
         ofpprop_end(msg, start);
     }
 
+    if (pin->odp_port) {
+        ofpprop_put_u32(msg, NXCPT_ODP_PORT, odp_to_u32(pin->odp_port));
+    }
+
     if (msg->size > inner_ofs) {
         ofpprop_end(msg, continuation_ofs);
     } else {
@@ -875,6 +880,13 @@ ofputil_decode_packet_in_private(const struct ofp_header *oh, bool loose,
             error = parse_actions_property(&payload, oh->version, &action_set);
             break;
 
+        case NXCPT_ODP_PORT: {
+            uint32_t value;
+            error = ofpprop_parse_u32(&payload, &value);
+            pin->odp_port = u32_to_odp(value);
+            break;
+         }
+
         default:
             error = OFPPROP_UNKNOWN(loose, "continuation", type);
             break;
@@ -1010,6 +1022,11 @@ ofputil_packet_in_private_format(struct ds *s,
         ds_put_char(s, '\n');
     }
 
+    if (pin->odp_port) {
+        ds_put_format(s, " continuation.odp_port=%"PRIu32, pin->odp_port);
+        ds_put_char(s, '\n');
+    }
+
     if (verbosity > 0) {
         char *packet = ofp_packet_to_string(
             public->packet, public->packet_len,