]> git.proxmox.com Git - mirror_ovs.git/blobdiff - lib/nx-match.c
Add connection tracking label support.
[mirror_ovs.git] / lib / nx-match.c
index 094a9757e44283d864f1e5efa86ff6718a71e922..7a343da88aaba53a6fff911f34acd9282cc51bc3 100644 (file)
@@ -781,6 +781,18 @@ nxm_put_frag(struct ofpbuf *b, const struct match *match,
                nw_frag_mask == FLOW_NW_FRAG_MASK ? UINT8_MAX : nw_frag_mask);
 }
 
+static void
+nxm_put_ct_label(struct ofpbuf *b,
+                 enum mf_field_id field, enum ofp_version version,
+                 const ovs_u128 value, const ovs_u128 mask)
+{
+    ovs_be128 bevalue, bemask;
+
+    hton128(&value, &bevalue);
+    hton128(&mask, &bemask);
+    nxm_put(b, field, version, &bevalue, &bemask, sizeof(bevalue));
+}
+
 /* Appends to 'b' a set of OXM or NXM matches for the IPv4 or IPv6 fields in
  * 'match'.  */
 static void
@@ -1043,6 +1055,8 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
                 htons(match->wc.masks.ct_zone));
     nxm_put_32m(b, MFF_CT_MARK, oxm, htonl(flow->ct_mark),
                 htonl(match->wc.masks.ct_mark));
+    nxm_put_ct_label(b, MFF_CT_LABEL, oxm, flow->ct_label,
+                     match->wc.masks.ct_label);
 
     /* OpenFlow 1.1+ Metadata. */
     nxm_put_64m(b, MFF_METADATA, oxm,