NET: Share correct feature code between bridging and bonding
commitd5e756e26a271662bab6a10df75f2b3f9bc54ef7
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 21 Aug 2007 06:22:55 +0000 (21 14:22 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 31 Aug 2007 06:01:00 +0000 (30 23:01 -0700)
treea02ba807e242dbccab2e35fddb1c608a1f18a3ac
parent1db5759e2d29c90d99659e132d4a137e20460061
NET: Share correct feature code between bridging and bonding

[NET]: Share correct feature code between bridging and bonding

http://bugzilla.kernel.org/show_bug.cgi?id=8797 shows that the
bonding driver may produce bogus combinations of the checksum
flags and SG/TSO.

For example, if you bond devices with NETIF_F_HW_CSUM and
NETIF_F_IP_CSUM you'll end up with a bonding device that
has neither flag set.  If both have TSO then this produces
an illegal combination.

The bridge device on the other hand has the correct code to
deal with this.

In fact, the same code can be used for both.  So this patch
moves that logic into net/core/dev.c and uses it for both
bonding and bridging.

In the process I've made small adjustments such as only
setting GSO_ROBUST if at least one constituent device
supports it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/bonding/bond_main.c
include/linux/netdevice.h
net/bridge/br_device.c
net/bridge/br_if.c
net/core/dev.c