aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2014-05-18 20:29:42 -0400
committerBen Hutchings <ben@decadent.org.uk>2014-05-18 20:29:42 -0400
commit61d88c6811f216de4ec26aafe24e650dc1aeb00e (patch)
tree4d5816d6ff92cecad8e3019d9d9653913970b6e9 /net/core
parent678e30df2e5664619e06fcfea5490a476826d8fe (diff)
ethtool: Disallow ETHTOOL_SRSSH with both indir table and hash key unchanged
This would be a no-op, so there is no reason to request it. This also allows conversion of the current implementations of ethtool_ops::{get,set}_rxfh_indir to ethtool_ops::{get,set}_rxfh with no change other than their parameters. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/ethtool.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 7156fe5ca876..b8857348bdf3 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -802,11 +802,14 @@ static noinline_for_stack int ethtool_set_rxfh(struct net_device *dev,
802 return -EFAULT; 802 return -EFAULT;
803 803
804 /* If either indir or hash key is valid, proceed further. 804 /* If either indir or hash key is valid, proceed further.
805 * It is not valid to request that both be unchanged.
805 */ 806 */
806 if ((user_indir_size && 807 if ((user_indir_size &&
807 user_indir_size != ETH_RXFH_INDIR_NO_CHANGE && 808 user_indir_size != ETH_RXFH_INDIR_NO_CHANGE &&
808 user_indir_size != dev_indir_size) || 809 user_indir_size != dev_indir_size) ||
809 (user_key_size && (user_key_size != dev_key_size))) 810 (user_key_size && (user_key_size != dev_key_size)) ||
811 (user_indir_size == ETH_RXFH_INDIR_NO_CHANGE &&
812 user_key_size == 0))
810 return -EINVAL; 813 return -EINVAL;
811 814
812 if (user_indir_size != ETH_RXFH_INDIR_NO_CHANGE) 815 if (user_indir_size != ETH_RXFH_INDIR_NO_CHANGE)