aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bonding.h
diff options
context:
space:
mode:
authorMoni Shoua <monis@voltaire.com>2007-10-09 22:43:43 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-15 14:20:46 -0400
commitd90a162a4ee280201e84944a84f86d6728dc0c27 (patch)
treeeff59bda3c6fcec2556b7d80838979e6fe705a43 /drivers/net/bonding/bonding.h
parent1053f62c24faa6d4ee6f5bfddeca847b84f67a95 (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.h3
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)
295struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr); 296struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr);
296int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev); 297int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, struct net_device *slave_dev);
297int bond_create(char *name, struct bond_params *params, struct bonding **newbond); 298int bond_create(char *name, struct bond_params *params, struct bonding **newbond);
299void bond_destroy(struct bonding *bond);
300int bond_release_and_destroy(struct net_device *bond_dev, struct net_device *slave_dev);
298void bond_deinit(struct net_device *bond_dev); 301void bond_deinit(struct net_device *bond_dev);
299int bond_create_sysfs(void); 302int bond_create_sysfs(void);
300void bond_destroy_sysfs(void); 303void bond_destroy_sysfs(void);