[ovs-dev] [PATCH] ofp-actions: Fix userspace support for mpls_ttl

Timothy Redaelli tredaelli at redhat.com
Fri Sep 18 17:19:35 UTC 2020


Currently mpls_ttl is ignored when a flow is added because MFF_MPLS_TTL is
not handled in nx_put_raw().

This commit adds the correct handling of MFF_MPLS_TTL in nx_put_raw().

Fixes: bef3f465bcd5 ("openflow: Support matching and modifying MPLS TTL field.")
Cc: blp at ovn.org
Signed-off-by: Timothy Redaelli <tredaelli at redhat.com>
---
 lib/nx-match.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/nx-match.c b/lib/nx-match.c
index 3ffd7d9d7..325a20ec6 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -1133,6 +1133,11 @@ nx_put_raw(struct ofpbuf *b, enum ofp_version oxm, const struct match *match,
                       mpls_lse_to_bos(flow->mpls_lse[0]));
         }
 
+        if (match->wc.masks.mpls_lse[0] & htonl(MPLS_TTL_MASK)) {
+            nxm_put_8(&ctx, MFF_MPLS_TTL, oxm,
+                       mpls_lse_to_ttl(flow->mpls_lse[0]));
+        }
+
         if (match->wc.masks.mpls_lse[0] & htonl(MPLS_LABEL_MASK)) {
             nxm_put_32(&ctx, MFF_MPLS_LABEL, oxm,
                        htonl(mpls_lse_to_label(flow->mpls_lse[0])));
-- 
2.26.2



More information about the dev mailing list