Beispiel #1
0
/* called under bridge lock */
static void br_check_timers(struct net_bridge *br)
{
	struct net_bridge_port *p;

	if (br_timer_has_expired(&br->gc_timer, br->gc_interval)) {
		br_timer_set(&br->gc_timer, jiffies);
		br_fdb_cleanup(br);
	}

	if (br_timer_has_expired(&br->hello_timer, br->hello_time)) {
		br_timer_clear(&br->hello_timer);
		br_hello_timer_expired(br);
	}

	if (br_timer_has_expired(&br->tcn_timer, br->bridge_hello_time)) {
		br_timer_clear(&br->tcn_timer);
		br_tcn_timer_expired(br);
	}

	if (br_timer_has_expired(&br->topology_change_timer, br->bridge_forward_delay + br->bridge_max_age)) {
		br_timer_clear(&br->topology_change_timer);
		br_topology_change_timer_expired(br);
	}

	p = br->port_list;
	while (p != NULL) {
		if (p->state != BR_STATE_DISABLED)
			br_check_port_timers(p);

		p = p->next;
	}
}
Beispiel #2
0
/* called under bridge lock */
void br_stp_disable_bridge(struct net_bridge *br)
{
	struct net_bridge_port *p;

	br->topology_change = 0;
	br->topology_change_detected = 0;
	br_timer_clear(&br->hello_timer);
	br_timer_clear(&br->topology_change_timer);
	br_timer_clear(&br->tcn_timer);
	br_timer_clear(&br->gc_timer);
	br_fdb_cleanup(br);

	p = br->port_list;
	while (p != NULL) {
		if (p->state != BR_STATE_DISABLED)
			br_stp_disable_port(p);

		p = p->next;
	}

	del_timer(&br->tick);
}