On 9/18/20 7:19 PM, Timothy Redaelli wrote:
> 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: [email protected]
> Signed-off-by: Timothy Redaelli <[email protected]>
> ---
Good catch, thanks!
The big issue is that we have almost no tests for these feature.
Could you, please, add some tests for this issue to tests/ovs-ofctl.at ?
It seems like we do not actually have tests for other mpls fields too,
but this might be addressed later.
Best regards, Ilya Maximets.
> 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])));
>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev