> -----Original Message-----
> From: Yi Yang [mailto:[email protected]]
> 
> +static bool
> +compose_dec_nsh_ttl_action(struct xlate_ctx *ctx) {
> +    struct flow *flow = &ctx->xin->flow;
> +
> +    if ((flow->packet_type == htonl(PT_NSH)) ||
> +        (flow->dl_type == htons(ETH_TYPE_NSH))) {
> +        ctx->wc->masks.nsh.ttl = 0xff;
> +        if (flow->nsh.ttl > 1) {
> +            flow->nsh.ttl--;
> +            return false;
> +        } else {
> +            execute_controller_action(ctx, UINT16_MAX, OFPR_INVALID_TTL,
> 0,
> +                                      NULL, 0);
> +        }
> +    }
> +
> +    /* Stop processing for current table. */
> +    xlate_report(ctx, OFT_WARN, "NSH decrement TTL exception");
> +    return true;

I see you followed the dec_mpls_ttl implementation here in that you terminate
translation and drop the packet when trying to decrement TTL of a non-NSH
packet. This is different from the dec_nw_ttl action, which does nothing when
executed on a non-IP packet. 

@Ben: What is the reason for different approaches in OVS?

@Yi: Why have you opted for the MPLS approach?

BR, Jan
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to