Skip to content

Commit

Permalink
openvswitch: Fix MPLS action validation.
Browse files Browse the repository at this point in the history
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: 25cd9ba ("openvswitch: Add basic MPLS support to
kernel").

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Reported-by: Srinivas Neginhal <sneginha@vmware.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pravin B Shelar authored and David S. Miller committed Dec 24, 2014
1 parent 4cc1bec commit ec449f4
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions net/openvswitch/flow_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1753,7 +1753,6 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr,
__be16 eth_type, __be16 vlan_tci, bool log)
{
const struct nlattr *a;
bool out_tnl_port = false;
int rem, err;

if (depth >= SAMPLE_ACTION_DEPTH)
Expand Down Expand Up @@ -1796,8 +1795,6 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr,
case OVS_ACTION_ATTR_OUTPUT:
if (nla_get_u32(a) >= DP_MAX_PORTS)
return -EINVAL;
out_tnl_port = false;

break;

case OVS_ACTION_ATTR_HASH: {
Expand Down Expand Up @@ -1832,12 +1829,6 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr,
case OVS_ACTION_ATTR_PUSH_MPLS: {
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))
return -EINVAL;
/* Prohibit push MPLS other than to a white list
Expand Down Expand Up @@ -1873,11 +1864,9 @@ static int __ovs_nla_copy_actions(const struct nlattr *attr,

case OVS_ACTION_ATTR_SET:
err = validate_set(a, key, sfa,
&out_tnl_port, eth_type, log);
&skip_copy, eth_type, log);
if (err)
return err;

skip_copy = out_tnl_port;
break;

case OVS_ACTION_ATTR_SAMPLE:
Expand Down

0 comments on commit ec449f4

Please sign in to comment.