Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 69d7126b authored by Hadar Hen Zion's avatar Hadar Hen Zion Committed by David S. Miller
Browse files

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: default avatarHadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f90a3673
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -669,6 +669,10 @@ static int mlx4_en_validate_flow(struct net_device *dev,
		    !(cmd->fs.m_ext.vlan_tci == 0 ||
		      cmd->fs.m_ext.vlan_tci == cpu_to_be16(0xfff)))
			return -EINVAL;
		if (cmd->fs.m_ext.vlan_tci) {
			if (be16_to_cpu(cmd->fs.h_ext.vlan_tci) >= VLAN_N_VID)
				return -EINVAL;
		}
	}

	return 0;