summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaime Caamaño Ruiz <jcaamano@suse.com>2018-10-31 18:52:03 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-04 14:51:53 +0100
commitf8c96597387ed9b15fa192ebdd87dbdf2668608c (patch)
tree9e5efd1118222f1174946bcd8ae67b1c01de1caa
parent0b73d75ab52ff0ed8e08a7fa18d4ab98ddcaac29 (diff)
downloadlinux-stable-f8c96597387ed9b15fa192ebdd87dbdf2668608c.tar.gz
linux-stable-f8c96597387ed9b15fa192ebdd87dbdf2668608c.tar.bz2
linux-stable-f8c96597387ed9b15fa192ebdd87dbdf2668608c.zip
openvswitch: Fix push/pop ethernet validation
[ Upstream commit 46ebe2834ba5b541f28ee72e556a3fed42c47570 ] 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> 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>
-rw-r--r--net/openvswitch/flow_netlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c
index 492ab0c36f7c..8b1ba43b1ece 100644
--- a/net/openvswitch/flow_netlink.c
+++ b/net/openvswitch/flow_netlink.c
@@ -2990,7 +2990,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:
@@ -2998,7 +2998,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: