summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTimothy Redaelli <tredaelli@redhat.com>2020-09-18 19:19:35 +0200
committerIlya Maximets <i.maximets@ovn.org>2020-11-16 17:47:11 +0100
commit84029cb5d4433bc6fcc4a28e3f8e397714d483ab (patch)
treee316052b4ca4be100cd27e1b039b6b3075cab6dc /lib
parentf4336f504b17c0a2d9f47eb1ae1b7b140e3cc72a (diff)
downloadopenvswitch-84029cb5d4433bc6fcc4a28e3f8e397714d483ab.tar.gz
ofp-actions: Fix userspace support for mpls_ttl.
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.") Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/nx-match.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/nx-match.c b/lib/nx-match.c
index 3ffd7d9d7..440f5f763 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])));