Re: Reset of setpathcost after link comes back up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
> In a redundant setup (2 bridges), I usally set the path cost of external ports
> to 1 und internal ports to 100. So that the external port of the backup bridge
> is in forwarding and the internal port in blocking state.
>

If my understanding of STP is correct you can achieve the same result
by setting port priorities on the designated bridge's ports.

> But, when the physical link goes down and comes back up (i.e. link failure or
> cable unplug and replug) the path cost of the links automatically reset to
> values like 4 and 19.
>
> Is this a desired behaviour, shouldn't the path cost remain at the values specified?

IMO this is the desired behaviour - the port path cost is recalculated
every time when link state change is detected, probably to accommodate
to possible link speed change.

> I'm using bridge support in Kernel 2.6.19. As I can't test a new Kernel yet, I'm
> just asking if this might be a bug and maybe someone knows if this has been
> fixed lately?
>
> Thanks in advance.
>
> Best,
>
> Lars

I am by no means an expert in the bridging code(and in kernel coding
in general) but it seems that the "fix" bellow will "solve" your
problem. But this is definitely not the right way to do it :)

Regards,
Vassil

--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -89,9 +89,6 @@ static void port_carrier_check(void *arg)
                goto done;
        br = p->br;

-       if (netif_carrier_ok(dev))
-               p->path_cost = port_cost(dev);
-
        if (br->dev->flags & IFF_UP) {
                spin_lock_bh(&br->lock);
                if (netif_carrier_ok(dev)) {
_______________________________________________
Bridge mailing list
Bridge@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/bridge

[Index of Archives]     [Netdev]     [AoE Tools]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux