Commit ec449f40 authored by Pravin B Shelar's avatar Pravin B Shelar Committed by David S. Miller

openvswitch: Fix MPLS action validation.

Linux stack does not implement GSO for packet with multiple
encapsulations.  Therefore there was check in MPLS action
validation to detect such case, But this check introduced
bug which deleted one or more actions from actions list.
Following patch removes this check to fix the validation.

Fixes: 25cd9ba0 ("openvswitch: Add basic MPLS support to
kernel").
Signed-off-by: default avatarPravin B Shelar <pshelar@nicira.com>
Reported-by: default avatarSrinivas Neginhal <sneginha@vmware.com>
Acked-by: default avatarJarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4cc1beca
...@@ -1753,7 +1753,6 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr, ...@@ -1753,7 +1753,6 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr,
__be16 eth_type, __be16 vlan_tci, bool log) __be16 eth_type, __be16 vlan_tci, bool log)
{ {
const struct nlattr *a; const struct nlattr *a;
bool out_tnl_port = false;
int rem, err; int rem, err;
if (depth >= SAMPLE_ACTION_DEPTH) if (depth >= SAMPLE_ACTION_DEPTH)
...@@ -1796,8 +1795,6 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr, ...@@ -1796,8 +1795,6 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr,
case OVS_ACTION_ATTR_OUTPUT: case OVS_ACTION_ATTR_OUTPUT:
if (nla_get_u32(a) >= DP_MAX_PORTS) if (nla_get_u32(a) >= DP_MAX_PORTS)
return -EINVAL; return -EINVAL;
out_tnl_port = false;
break; break;
case OVS_ACTION_ATTR_HASH: { case OVS_ACTION_ATTR_HASH: {
...@@ -1832,12 +1829,6 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr, ...@@ -1832,12 +1829,6 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr,
case OVS_ACTION_ATTR_PUSH_MPLS: { case OVS_ACTION_ATTR_PUSH_MPLS: {
const struct ovs_action_push_mpls *mpls = nla_data(a); const struct ovs_action_push_mpls *mpls = nla_data(a);
/* Networking stack do not allow simultaneous Tunnel
* and MPLS GSO.
*/
if (out_tnl_port)
return -EINVAL;
if (!eth_p_mpls(mpls->mpls_ethertype)) if (!eth_p_mpls(mpls->mpls_ethertype))
return -EINVAL; return -EINVAL;
/* Prohibit push MPLS other than to a white list /* Prohibit push MPLS other than to a white list
...@@ -1873,11 +1864,9 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr, ...@@ -1873,11 +1864,9 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr,
case OVS_ACTION_ATTR_SET: case OVS_ACTION_ATTR_SET:
err = validate_set(a, key, sfa, err = validate_set(a, key, sfa,
&out_tnl_port, eth_type, log); &skip_copy, eth_type, log);
if (err) if (err)
return err; return err;
skip_copy = out_tnl_port;
break; break;
case OVS_ACTION_ATTR_SAMPLE: case OVS_ACTION_ATTR_SAMPLE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment