Subject: Re: [RFC] [PATCH] ethtool: Change ethtool_op_set_flags to validate flags

From: Jeff Garzik <[email-masked]>
Date: Wed, 30 Jun 2010 01:26:54 -0400

On 06/29/2010 12:01 PM, Ben Hutchings wrote:
> This is the sort of change I'd like to see.
>
> Ben.
>
> ---
> ethtool_op_set_flags() does not check for unsupported flags, and has
> no way of doing so.  This means it is not suitable for use as a
> default implementation of ethtool_ops::set_flags.
>
> Add a 'supported' parameter specifying the flags that the driver and
> hardware support, validate the requested flags against this, and
> change all current callers to pass this parameter.
>
> Change some other trivial implementations of ethtool_ops::set_flags to
> call ethtool_op_set_flags().
> ---
>   drivers/net/cxgb4/cxgb4_main.c    |    9 +--------
>   drivers/net/enic/enic_main.c      |    1 -
>   drivers/net/ixgbe/ixgbe_ethtool.c |    5 ++++-
>   drivers/net/mv643xx_eth.c         |    7 ++++++-
>   drivers/net/myri10ge/myri10ge.c   |   10 +++++++---
>   drivers/net/niu.c                 |    9 +--------
>   drivers/net/sfc/ethtool.c         |    5 +----
>   drivers/net/sky2.c                |   16 ++++++----------
>   include/linux/ethtool.h           |    2 +-
>   net/core/ethtool.c                |   28 +++++-----------------------
>   10 files changed, 32 insertions(+), 60 deletions(-)

Acked-by: Jeff Garzik <[email-masked]>

I think that's a better way to do it...