Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69314
b: refs/heads/master
c: 3158bf7
h: refs/heads/master
v: v3
  • Loading branch information
Moni Shoua authored and Jeff Garzik committed Oct 15, 2007
1 parent ea5a3c9 commit 1230b1d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6b1bf096508c870889c2be63c7757a04d72116fe
refs/heads/master: 3158bf7d414b69fdc0c715d0a4d82e12b74ef974
3 changes: 2 additions & 1 deletion trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,8 @@ static int bond_compute_features(struct bonding *bond)
struct slave *slave;
struct net_device *bond_dev = bond->dev;
unsigned long features = bond_dev->features;
unsigned short max_hard_header_len = ETH_HLEN;
unsigned short max_hard_header_len = max((u16)ETH_HLEN,
bond_dev->hard_header_len);
int i;

features &= ~(NETIF_F_ALL_CSUM | BOND_VLAN_FEATURES);
Expand Down
10 changes: 8 additions & 2 deletions trunk/drivers/net/bonding/bond_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ static ssize_t bonding_store_slaves(struct device *d,
char command[IFNAMSIZ + 1] = { 0, };
char *ifname;
int i, res, found, ret = count;
u32 original_mtu;
struct slave *slave;
struct net_device *dev = NULL;
struct bonding *bond = to_bond(d);
Expand Down Expand Up @@ -325,6 +326,7 @@ static ssize_t bonding_store_slaves(struct device *d,
}

/* Set the slave's MTU to match the bond */
original_mtu = dev->mtu;
if (dev->mtu != bond->dev->mtu) {
if (dev->change_mtu) {
res = dev->change_mtu(dev,
Expand All @@ -339,6 +341,9 @@ static ssize_t bonding_store_slaves(struct device *d,
}
rtnl_lock();
res = bond_enslave(bond->dev, dev);
bond_for_each_slave(bond, slave, i)
if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0)
slave->original_mtu = original_mtu;
rtnl_unlock();
if (res) {
ret = res;
Expand All @@ -351,6 +356,7 @@ static ssize_t bonding_store_slaves(struct device *d,
bond_for_each_slave(bond, slave, i)
if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) {
dev = slave->dev;
original_mtu = slave->original_mtu;
break;
}
if (dev) {
Expand All @@ -365,9 +371,9 @@ static ssize_t bonding_store_slaves(struct device *d,
}
/* set the slave MTU to the default */
if (dev->change_mtu) {
dev->change_mtu(dev, 1500);
dev->change_mtu(dev, original_mtu);
} else {
dev->mtu = 1500;
dev->mtu = original_mtu;
}
}
else {
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/bonding/bonding.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ struct slave {
s8 link; /* one of BOND_LINK_XXXX */
s8 state; /* one of BOND_STATE_XXXX */
u32 original_flags;
u32 original_mtu;
u32 link_failure_count;
u16 speed;
u8 duplex;
Expand Down

0 comments on commit 1230b1d

Please sign in to comment.