Skip to content

Commit

Permalink
ofp-actions: Fix userspace support for mpls_ttl.
Browse files Browse the repository at this point in the history
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: bef3f46 ("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>
  • Loading branch information
drizzt authored and igsilya committed Nov 16, 2020
1 parent 8139388 commit e5c2f7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/nx-match.c
Expand Up @@ -1110,6 +1110,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])));
Expand Down

0 comments on commit e5c2f7e

Please sign in to comment.