--- zzzz-none-000/linux-2.4.17/net/bridge/br_if.c 2001-12-21 17:42:05.000000000 +0000 +++ sangam-fb-401/linux-2.4.17/net/bridge/br_if.c 2005-10-07 07:20:32.000000000 +0000 @@ -5,7 +5,7 @@ * Authors: * Lennert Buytenhek * - * $Id: br_if.c,v 1.6 2001/11/24 17:51:03 davem Exp $ + * $Id: br_if.c,v 1.3 2003/10/03 20:39:41 mhassler Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -46,6 +46,10 @@ if ((p = dev->br_port) == NULL) return -EINVAL; +#ifdef AVM_DELAYQUEUE + br_delayqueue_discard_frames(br , dev); +#endif + br_stp_disable_port(p); dev_set_promiscuity(dev, -1); @@ -63,12 +67,13 @@ br_fdb_delete_by_port(br, p); kfree(p); + dev_put(dev); return 0; } -static struct net_bridge **__find_br(char *name) +struct net_bridge **__find_br(char *name) { struct net_bridge **b; struct net_bridge *br; @@ -111,17 +116,21 @@ br->lock = RW_LOCK_UNLOCKED; br->hash_lock = RW_LOCK_UNLOCKED; +#ifdef AVM_DELAYQUEUE + skb_queue_head_init(&br->delayqueue); +#endif + br->bridge_id.prio[0] = 0x80; br->bridge_id.prio[1] = 0x00; memset(br->bridge_id.addr, 0, ETH_ALEN); - br->stp_enabled = 1; + br->stp_enabled = 0; br->designated_root = br->bridge_id; br->root_path_cost = 0; br->root_port = 0; - br->bridge_max_age = br->max_age = 20 * HZ; + br->bridge_max_age = br->max_age = 6 * HZ; br->bridge_hello_time = br->hello_time = 2 * HZ; - br->bridge_forward_delay = br->forward_delay = 15 * HZ; + br->bridge_forward_delay = br->forward_delay = 4 * HZ; br->topology_change = 0; br->topology_change_detected = 0; br_timer_clear(&br->hello_timer); @@ -131,6 +140,9 @@ br->ageing_time = 300 * HZ; br->gc_interval = 4 * HZ; + /*Set Bridge Filter to be Off br Default*/ + br->br_filter_active = 0; + return br; } @@ -140,7 +152,7 @@ int i; struct net_bridge_port *p; - p = kmalloc(sizeof(*p), GFP_KERNEL); + p = kmalloc(sizeof(*p), GFP_ATOMIC); if (p == NULL) return p; @@ -205,6 +217,17 @@ if (br->dev.flags & IFF_UP) return -EBUSY; +#ifdef AVM_DELAYQUEUE + /* destroy the delay queue */ + if (br->tokens_per_tick) { + br->tokens_per_tick = 0; + del_timer(&br->token_tick); + } + br_delayqueue_handle_frames(br); +#endif + + br_flush_filter(br); + del_ifs(br); *b = br->next; @@ -236,7 +259,7 @@ dev_set_promiscuity(dev, 1); - br_stp_recalculate_bridge_id(br); + if (!br->automatic_mac_disabled) br_stp_recalculate_bridge_id(br); br_fdb_insert(br, p, dev->dev_addr, 1); if ((br->dev.flags & IFF_UP) && (dev->flags & IFF_UP)) br_stp_enable_port(p); @@ -251,7 +274,12 @@ write_lock_bh(&br->lock); retval = __br_del_if(br, dev); - br_stp_recalculate_bridge_id(br); + if (!br->automatic_mac_disabled) br_stp_recalculate_bridge_id(br); + else { + /* UDO: be sure that the bridge id is still in the fdb */ + /* note the the port in the fdb-entry will not be overwritten with 0, if the entry exists */ + br_fdb_insert(br, 0, br->bridge_id.addr, 1/*local*/); + } write_unlock_bh(&br->lock); return retval;