[ovs-dev] [nxm 39/42] ofproto: Factor out code from do_xlate_actions() into new function.

Justin Pettit jpettit at nicira.com
Tue Nov 9 23:04:12 UTC 2010


On Oct 28, 2010, at 10:28 AM, Ben Pfaff wrote:

> static void
> +xlate_set_dl_tci(struct action_xlate_ctx *ctx)
> +{
> +    ovs_be16 dl_vlan = ctx->flow.dl_vlan;
> +    uint8_t dl_vlan_pcp = ctx->flow.dl_vlan_pcp;
> +
> +    if (dl_vlan == htons(OFP_VLAN_NONE)) {
> +        odp_actions_add(ctx->out, ODPAT_STRIP_VLAN);
> +    } else {
> +        union odp_action *oa = odp_actions_add(ctx->out, ODPAT_SET_DL_TCI);
> +        oa->dl_tci.tci = (ntohs(dl_vlan & htons(VLAN_VID_MASK))
> +                          | ((dl_vlan_pcp << VLAN_PCP_SHIFT) & VLAN_PCP_MASK)
> +                          | VLAN_CFI);
> +    }
> +}

Isn't "oa->dl_tci.tci" supposed to be in network-byte order?  It seems like this is storing it in host-byte order.

--Justin






More information about the dev mailing list