Skip to content

Commit 1d50b74

Browse files
jcaamanogregkh
authored andcommitted
openvswitch: Fix push/pop ethernet validation
[ Upstream commit 46ebe28 ] 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: 91820da ("openvswitch: add Ethernet push and pop actions") Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com> Tested-by: Greg Rose <gvrose8192@gmail.com> Reviewed-by: Greg Rose <gvrose8192@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f288424 commit 1d50b74

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

net/openvswitch/flow_netlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,15 +2622,15 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
26222622
* is already present */
26232623
if (mac_proto != MAC_PROTO_NONE)
26242624
return -EINVAL;
2625-
mac_proto = MAC_PROTO_NONE;
2625+
mac_proto = MAC_PROTO_ETHERNET;
26262626
break;
26272627

26282628
case OVS_ACTION_ATTR_POP_ETH:
26292629
if (mac_proto != MAC_PROTO_ETHERNET)
26302630
return -EINVAL;
26312631
if (vlan_tci & htons(VLAN_TAG_PRESENT))
26322632
return -EINVAL;
2633-
mac_proto = MAC_PROTO_ETHERNET;
2633+
mac_proto = MAC_PROTO_NONE;
26342634
break;
26352635

26362636
default:

0 commit comments

Comments
 (0)