mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
openvswitch: Fix push/pop ethernet validation
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: 91820da6ae
("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>
This commit is contained in:
parent
30549aab14
commit
46ebe2834b
1 changed files with 2 additions and 2 deletions
|
@ -3030,7 +3030,7 @@ static int __ovs_nla_copy_actions(struct net *net, const struct nlattr *attr,
|
||||||
* is already present */
|
* is already present */
|
||||||
if (mac_proto != MAC_PROTO_NONE)
|
if (mac_proto != MAC_PROTO_NONE)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
mac_proto = MAC_PROTO_NONE;
|
mac_proto = MAC_PROTO_ETHERNET;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OVS_ACTION_ATTR_POP_ETH:
|
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;
|
return -EINVAL;
|
||||||
if (vlan_tci & htons(VLAN_TAG_PRESENT))
|
if (vlan_tci & htons(VLAN_TAG_PRESENT))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
mac_proto = MAC_PROTO_ETHERNET;
|
mac_proto = MAC_PROTO_NONE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OVS_ACTION_ATTR_PUSH_NSH:
|
case OVS_ACTION_ATTR_PUSH_NSH:
|
||||||
|
|
Loading…
Reference in a new issue