diff options
Diffstat (limited to 'net/hsr/hsr_device.c')
-rw-r--r-- | net/hsr/hsr_device.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 4e5d92a8f079..f224067153e4 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -429,7 +429,8 @@ static void hsr_dev_destroy(struct net_device *hsr_dev) hsr = netdev_priv(hsr_dev); - del_timer(&hsr->announce_timer); + del_timer_sync(&hsr->prune_timer); + del_timer_sync(&hsr->announce_timer); unregister_hsr_master(hsr); /* calls list_del_rcu on hsr */ restore_slaves(hsr_dev); call_rcu(&hsr->rcu_head, reclaim_hsr_dev); /* reclaim hsr */ @@ -523,6 +524,10 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], hsr->announce_timer.function = hsr_announce; hsr->announce_timer.data = (unsigned long) hsr; + init_timer(&hsr->prune_timer); + hsr->prune_timer.function = hsr_prune_nodes; + hsr->prune_timer.data = (unsigned long) hsr; + ether_addr_copy(hsr->sup_multicast_addr, def_multicast_addr); hsr->sup_multicast_addr[ETH_ALEN - 1] = multicast_spec; @@ -596,6 +601,9 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], if (res) goto fail; + hsr->prune_timer.expires = jiffies + msecs_to_jiffies(PRUNE_PERIOD); + add_timer(&hsr->prune_timer); + register_hsr_master(hsr); return 0; |