All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory Rose <gvrose8192@gmail.com>
To: "Jaime Caamaño Ruiz" <jcaamano@suse.com>, netdev@vger.kernel.org
Cc: pshelar@ovn.org
Subject: Re: [PATCH net] openvswitch: Fix push/pop ethernet validation
Date: Wed, 31 Oct 2018 13:13:02 -0700	[thread overview]
Message-ID: <240a9f02-2a4a-8be3-4202-44b1f072db84@gmail.com> (raw)
In-Reply-To: <20181031175203.23808-1-jcaamano@suse.com>

On 10/31/2018 10:52 AM, Jaime Caamaño Ruiz wrote:
> When there are both pop and push ethernet header actions among the
> actions to be applied to a packet, an unexpected EINVAL (Invalid
> argument) error is obtained. This is due to mac_proto not being reset
> correctly when those actions are validated.
>
> Reported-at:
> https://mail.openvswitch.org/pipermail/ovs-discuss/2018-October/047554.html
> Fixes: 91820da6ae85 ("openvswitch: add Ethernet push and pop actions")
> Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
> ---
>   net/openvswitch/flow_netlink.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
> index a70097ecf33c..865ecef68196 100644
> --- a/net/openvswitch/flow_netlink.c
> +++ b/net/openvswitch/flow_netlink.c
> @@ -3030,7 +3030,7 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
>   			 * is already present */
>   			if (mac_proto != MAC_PROTO_NONE)
>   				return -EINVAL;
> -			mac_proto = MAC_PROTO_NONE;
> +			mac_proto = MAC_PROTO_ETHERNET;
>   			break;
>   
>   		case OVS_ACTION_ATTR_POP_ETH:
> @@ -3038,7 +3038,7 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
>   				return -EINVAL;
>   			if (vlan_tci & htons(VLAN_TAG_PRESENT))
>   				return -EINVAL;
> -			mac_proto = MAC_PROTO_ETHERNET;
> +			mac_proto = MAC_PROTO_NONE;
>   			break;
>   
>   		case OVS_ACTION_ATTR_PUSH_NSH:

Thanks Jaime!

Tested-by: Greg Rose <gvrose8192@gmail.com>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>

  reply	other threads:[~2018-11-01  5:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-31 17:52 [PATCH net] openvswitch: Fix push/pop ethernet validation Jaime Caamaño Ruiz
2018-10-31 20:13 ` Gregory Rose [this message]
2018-11-01  1:38 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=240a9f02-2a4a-8be3-4202-44b1f072db84@gmail.com \
    --to=gvrose8192@gmail.com \
    --cc=jcaamano@suse.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@ovn.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.