Tom Gundersen
2014-Apr-21 19:33 UTC
[Bridge] [BUG?] bridge_id not getting set for bridges created with
Hi, If IFLA_ADDRESS is set when creating a bridge over netlink, e.g. # ip link add test-bridge address b6:83:a2:b3:2f:0e type bride the bridge id is not set: # brctl show bridge name bridge id STP enabled interfaces bridge1 8000.000000000000 no It looks like this is caused by br_stp_set_bridge_id never beeing called. There appear to be many ways to solve this, but not sure what is the preferred route... Cheers, Tom
Tom Gundersen
2014-Apr-21 20:56 UTC
Re: [BUG?] bridge_id not getting set for bridges created with
On Mon, Apr 21, 2014 at 9:33 PM, Tom Gundersen <teg@jklm.no> wrote:> Hi, > > If IFLA_ADDRESS is set when creating a bridge over netlink, e.g. > > # ip link add test-bridge address b6:83:a2:b3:2f:0e type bride > > the bridge id is not set: > > # brctl show > bridge name bridge id STP enabled interfaces > bridge1 8000.000000000000 noMy example was incomplete. To see the bug one should of course first add an interface to the bridge: # brctl addif bridge1 eth0 and observe that the bridge id remains unset: # brctl show bridge name bridge id STP enabled interfaces bridge1 8000.000000000000 no eth0 If bridge1 had been created without specifying the mac address the result is as expected: # brctl show bridge name bridge id STP enabled interfaces bridge1 8000.28d244547cdb no eth0 Cheers, Tom
Tom Gundersen
2014-Apr-21 20:56 UTC
[Bridge] [BUG?] bridge_id not getting set for bridges created with
On Mon, Apr 21, 2014 at 9:33 PM, Tom Gundersen <teg at jklm.no> wrote:> Hi, > > If IFLA_ADDRESS is set when creating a bridge over netlink, e.g. > > # ip link add test-bridge address b6:83:a2:b3:2f:0e type bride > > the bridge id is not set: > > # brctl show > bridge name bridge id STP enabled interfaces > bridge1 8000.000000000000 noMy example was incomplete. To see the bug one should of course first add an interface to the bridge: # brctl addif bridge1 eth0 and observe that the bridge id remains unset: # brctl show bridge name bridge id STP enabled interfaces bridge1 8000.000000000000 no eth0 If bridge1 had been created without specifying the mac address the result is as expected: # brctl show bridge name bridge id STP enabled interfaces bridge1 8000.28d244547cdb no eth0 Cheers, Tom
Toshiaki Makita
2014-Apr-24 12:06 UTC
[Bridge] [BUG?] bridge_id not getting set for bridges created with
On Mon, 2014-04-21 at 22:56 +0200, Tom Gundersen wrote:> On Mon, Apr 21, 2014 at 9:33 PM, Tom Gundersen <teg at jklm.no> wrote: > > Hi, > > > > If IFLA_ADDRESS is set when creating a bridge over netlink, e.g. > > > > # ip link add test-bridge address b6:83:a2:b3:2f:0e type bride > > > > the bridge id is not set: > > > > # brctl show > > bridge name bridge id STP enabled interfaces > > bridge1 8000.000000000000 no > > My example was incomplete. To see the bug one should of course first > add an interface to the bridge: > > # brctl addif bridge1 eth0 > > > and observe that the bridge id remains unset: > > # brctl show > bridge name bridge id STP enabled interfaces > bridge1 8000.000000000000 no eth0 > > > > If bridge1 had been created without specifying the mac address the > result is as expected: > > # brctl show > bridge name bridge id STP enabled interfaces > bridge1 8000.28d244547cdb no eth0 >Hi. This seems to be a bug. What's worse is that local fdb entry won't be created and we will not be able to receive frames on the bridge device... rtnl_create_link() doesn't call ndo_set_mac_address but populates dev->dev_addr by itself. I'm not sure if it is safe to call ndo_set_mac_address in this function (maybe affects other drivers). I think this can be handled in bridge codes (br_link_ops->newlink). I'm submitting a patch to fix this. Thanks, Toshiaki Makita