ethtool: Centralise validation of ETHTOOL_{G, S}RXFHINDIR parameters
commit7850f63f1620512631445b901ae11cd149e7375c
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 15 Dec 2011 13:55:01 +0000 (15 13:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Dec 2011 18:52:47 +0000 (16 13:52 -0500)
treed26a5f049dcf3634c4bf9e1b86915d201fab3836
parent14596f7006297b67516e2b6a2b26bcb11fe08fb3
ethtool: Centralise validation of ETHTOOL_{G, S}RXFHINDIR parameters

Add a new ethtool operation (get_rxfh_indir_size) to get the
indirectional table size.  Use this to validate the user buffer size
before calling get_rxfh_indir or set_rxfh_indir.  Use get_rxnfc to get
the number of RX rings, and validate the contents of the new
indirection table before calling set_rxfh_indir.  Remove this
validation from drivers.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Acked-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
drivers/net/ethernet/sfc/ethtool.c
drivers/net/vmxnet3/vmxnet3_ethtool.c
include/linux/ethtool.h
net/core/ethtool.c