aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHadar Hen Zion <hadarh@mellanox.com>2013-01-30 18:07:05 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-31 12:48:46 -0500
commit69d7126b7fef09beaa4b7c103ec2a5bd8c8b2666 (patch)
tree15f525f1d31bb6cadc47ed766d6552de2ddef1ef
parentf90a36734a6a0d843baa37b7caa1ef020f799d47 (diff)
net/mlx4_en: Validate VLAN IDs provided in ethtool flow steering rules
When attaching flow steering rules via Ethtool accept only valid vlans IDs e.g in the range: [0,4095]. Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_ethtool.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
index 86afb5b0e0fa..f33049f9bfe7 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
@@ -669,6 +669,10 @@ static int mlx4_en_validate_flow(struct net_device *dev,
669 !(cmd->fs.m_ext.vlan_tci == 0 || 669 !(cmd->fs.m_ext.vlan_tci == 0 ||
670 cmd->fs.m_ext.vlan_tci == cpu_to_be16(0xfff))) 670 cmd->fs.m_ext.vlan_tci == cpu_to_be16(0xfff)))
671 return -EINVAL; 671 return -EINVAL;
672 if (cmd->fs.m_ext.vlan_tci) {
673 if (be16_to_cpu(cmd->fs.h_ext.vlan_tci) >= VLAN_N_VID)
674 return -EINVAL;
675 }
672 } 676 }
673 677
674 return 0; 678 return 0;