From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregory Rose Subject: Re: [PATCH net] openvswitch: Fix push/pop ethernet validation Date: Wed, 31 Oct 2018 13:13:02 -0700 Message-ID: <240a9f02-2a4a-8be3-4202-44b1f072db84@gmail.com> References: <20181031175203.23808-1-jcaamano@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: pshelar@ovn.org To: =?UTF-8?Q?Jaime_Caama=c3=b1o_Ruiz?= , netdev@vger.kernel.org Return-path: Received: from mail-pf1-f194.google.com ([209.85.210.194]:37900 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729344AbeKAFMl (ORCPT ); Thu, 1 Nov 2018 01:12:41 -0400 Received: by mail-pf1-f194.google.com with SMTP id b11-v6so8149712pfi.5 for ; Wed, 31 Oct 2018 13:13:05 -0700 (PDT) In-Reply-To: <20181031175203.23808-1-jcaamano@suse.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 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 > --- > 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 Reviewed-by: Greg Rose