ehea: Avoid changing vlan flags
authorBreno Leitao <leitao@linux.vnet.ibm.com>
Mon, 20 Dec 2010 09:02:37 +0000 (09:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Dec 2010 21:51:22 +0000 (13:51 -0800)
This patch avoids disabling the vlan flags using ethtool.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ehea/ehea_ethtool.c

index 1f37ee6..d6cf502 100644 (file)
@@ -263,6 +263,13 @@ static void ehea_get_ethtool_stats(struct net_device *dev,
 
 static int ehea_set_flags(struct net_device *dev, u32 data)
 {
+       /* Avoid changing the VLAN flags */
+       if ((data & (ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN)) !=
+           (ethtool_op_get_flags(dev) & (ETH_FLAG_RXVLAN |
+                                         ETH_FLAG_TXVLAN))){
+               return -EINVAL;
+       }
+
        return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO
                                        | ETH_FLAG_TXVLAN
                                        | ETH_FLAG_RXVLAN);