Commit 54ef3137 authored by Jay Vosburgh's avatar Jay Vosburgh Committed by Jeff Garzik

[PATCH] bonding: Handle large hard_header_len

The bonding driver fails to adjust its hard_header_len when enslaving
interfaces.  Whenever an interface with a hard_header_len greater than the
ETH_HLEN default is enslaved, the potential for an oops exists, and if the
oops happens while responding to an arp request, for example, the system
panics.  GIANFAR devices may use an extended hard_header for VLAN or
hardware checksumming.  Enslaving such a device and then transmitting over
it causes a kernel panic.

Patch modified from submitter's original, but submitter agreed with this
patch in private email.
Signed-off-by: default avatarMark Huth <mhuth@mvista.com>
Signed-off-by: default avatarJay Vosburgh <fubar@us.ibm.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent a50d8de2
...@@ -1211,10 +1211,14 @@ static int bond_compute_features(struct bonding *bond) ...@@ -1211,10 +1211,14 @@ static int bond_compute_features(struct bonding *bond)
unsigned long features = BOND_INTERSECT_FEATURES; unsigned long features = BOND_INTERSECT_FEATURES;
struct slave *slave; struct slave *slave;
struct net_device *bond_dev = bond->dev; struct net_device *bond_dev = bond->dev;
unsigned short max_hard_header_len = ETH_HLEN;
int i; int i;
bond_for_each_slave(bond, slave, i) bond_for_each_slave(bond, slave, i) {
features &= (slave->dev->features & BOND_INTERSECT_FEATURES); features &= (slave->dev->features & BOND_INTERSECT_FEATURES);
if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len;
}
if ((features & NETIF_F_SG) && if ((features & NETIF_F_SG) &&
!(features & NETIF_F_ALL_CSUM)) !(features & NETIF_F_ALL_CSUM))
...@@ -1232,6 +1236,7 @@ static int bond_compute_features(struct bonding *bond) ...@@ -1232,6 +1236,7 @@ static int bond_compute_features(struct bonding *bond)
features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES); features |= (bond_dev->features & ~BOND_INTERSECT_FEATURES);
bond_dev->features = features; bond_dev->features = features;
bond_dev->hard_header_len = max_hard_header_len;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment