[ovs-dev] [PATCH v3 1/4] Add support for 802.1ad (QinQ tunneling)

Eric Garver e at erig.me
Fri Jul 22 20:45:46 UTC 2016


On Sun, Jul 03, 2016 at 08:47:06AM +0800, Xiao Liang wrote:
> diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
> index 997cc15..d8eac93 100644
> --- a/lib/ofp-actions.c
> +++ b/lib/ofp-actions.c
> @@ -1653,21 +1654,19 @@ parse_PUSH_VLAN(char *arg, struct ofpbuf *ofpacts,
>          return error;
>      }
>  
> -    if (ethertype != ETH_TYPE_VLAN_8021Q) {
> -        /* XXX ETH_TYPE_VLAN_8021AD case isn't supported */
> +    if (!eth_type_vlan(htons(ethertype))) {
>          return xasprintf("%s: not a valid VLAN ethertype", arg);
>      }
> -
> -    ofpact_put_PUSH_VLAN(ofpacts);
> +    push_vlan = ofpact_put_PUSH_VLAN(ofpacts);
> +    push_vlan->ethertype = htons(ethertype);
>      return NULL;
>  }
>  
>  static void
> -format_PUSH_VLAN(const struct ofpact_null *a OVS_UNUSED, struct ds *s)
> +format_PUSH_VLAN(const struct ofpact_push_vlan *push_vlan, struct ds *s)
>  {
> -    /* XXX 802.1AD case*/
>      ds_put_format(s, "%spush_vlan:%s%#"PRIx16,
> -                  colors.param, colors.end, ETH_TYPE_VLAN_8021Q);
> +                  colors.param, colors.end, htons(push_vlan->ethertype));

This should be ntohs(push_vlan->ethertype). push_vlan->ethertype is a
ovs_be16.



More information about the dev mailing list