From: Jaime Caamaño Ruiz Date: Wed, 31 Oct 2018 17:52:03 +0000 (+0100) Subject: openvswitch: Fix push/pop ethernet validation X-Git-Tag: v5.4-rc1~2289^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46ebe2834ba5b541f28ee72e556a3fed42c47570;p=platform%2Fkernel%2Flinux-rpi.git 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: 91820da6ae85 ("openvswitch: add Ethernet push and pop actions") Signed-off-by: Jaime Caamaño Ruiz Tested-by: Greg Rose Reviewed-by: Greg Rose Signed-off-by: David S. Miller --- diff --git a/net/openvswitch/flow_netlink.c b/net/openvswitch/flow_netlink.c index a70097e..865ecef 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: