diff options
author | Moni Shoua <monis@voltaire.com> | 2007-10-09 22:43:43 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-10-15 14:20:46 -0400 |
commit | d90a162a4ee280201e84944a84f86d6728dc0c27 (patch) | |
tree | eff59bda3c6fcec2556b7d80838979e6fe705a43 /drivers/net/bonding/bonding.h | |
parent | 1053f62c24faa6d4ee6f5bfddeca847b84f67a95 (diff) |
net/bonding: Destroy bonding master when last slave is gone
When bonding enslaves non Ethernet devices it takes pointers to functions
in the module that owns the slaves. In this case it becomes unsafe
to keep the bonding master registered after last slave was unenslaved
because we don't know if the pointers are still valid. Destroying the bond when slave_cnt is zero
ensures that these functions be used anymore.
Signed-off-by: Moni Shoua <monis at voltaire.com>
Acked-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r-- | drivers/net/bonding/bonding.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index e0e06a84b5b9..85e579b0d6f4 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -188,6 +188,7 @@ struct bonding { | |||
188 | s8 kill_timers; | 188 | s8 kill_timers; |
189 | s8 do_set_mac_addr; | 189 | s8 do_set_mac_addr; |
190 | s8 send_grat_arp; | 190 | s8 send_grat_arp; |
191 | s8 setup_by_slave; | ||
191 | struct net_device_stats stats; | 192 | struct net_device_stats stats; |
192 | #ifdef CONFIG_PROC_FS | 193 | #ifdef CONFIG_PROC_FS |
193 | struct proc_dir_entry *proc_entry; | 194 | struct proc_dir_entry *proc_entry; |
@@ -295,6 +296,8 @@ static inline void bond_unset_master_alb_flags(struct bonding *bond) | |||
295 | struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr); | 296 | struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr); |
296 | int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); | 297 | int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); |
297 | int bond_create(char *name, struct bond_params *params, struct bonding **newbond); | 298 | int bond_create(char *name, struct bond_params *params, struct bonding **newbond); |
299 | void bond_destroy(struct bonding *bond); | ||
300 | int bond_release_and_destroy(struct net_device *bond_dev, struct net_device *slave_dev); | ||
298 | void bond_deinit(struct net_device *bond_dev); | 301 | void bond_deinit(struct net_device *bond_dev); |
299 | int bond_create_sysfs(void); | 302 | int bond_create_sysfs(void); |
300 | void bond_destroy_sysfs(void); | 303 | void bond_destroy_sysfs(void); |