link cache fails to get updated when interface added to/removed from bridge

David Mosberger davidm at egauge.net
Mon Apr 14 13:26:50 PDT 2014


Just for the record, here is what I see after I configured a bridge
br0 with two dummy interfaces and then remove one interface with
"brctl delif br0 dummy1":

$ ./a.out
br0: dummy0 dummy1
[  607.950000] device dummy1 left promiscuous mode
[  607.960000] br0: port 2(dummy1) entered disabled state
cache manager got update
br0: dummy0 dummy1

This is on an embedded arm platform.

  --david


On Mon, Apr 14, 2014 at 12:25 PM, David Mosberger <davidm at egauge.net> wrote:
> Thomas,
>
> Thanks for your response.
> Your output is what I'd love to see.  Did you use brctl addif/delif to
> add/remove devices from the bridge?
>   --david
>
> On Mon, Apr 14, 2014 at 11:11 AM, Thomas Haller <thaller at redhat.com> wrote:
>> On Thu, 2014-04-03 at 23:04 -0600, David Mosberger wrote:
>>> I'm trying to use libnl-3 v3.2.11 to track the interfaces that are
>>> part of a bridge.
>>> I can read the initial state fine but updates don't seem to get reflected in the
>>> cache.  I attached a short test-program.
>>>
>>> The test-program assumes a bridge called br0 exists.  show_bridge() is
>>> supposed to list all the interfaces part of the bridge.  On startup, the correct
>>> list is printed.  However, when I add/remove an interface to/from the bridge
>>> with brctl addif br0 eth0/brctl delif br0 eth0, respectively, the cache doesn't
>>> get updated, even though I do see route/link::new and route/link:del
>>> messages coming from the kernel.
>>>
>>> Is there a bug in my program?
>>
>>
>> Hi David,
>>
>>
>> sorry for the late reply.
>>
>> Your program seems to work for me:
>>
>>
>> ~/libnl ((libnl3_2_11) +)$ gcc -Iinclude/ -Llib/.libs/ -lnl-route-3 -lnl-3 a.c
>> ~/libnl ((libnl3_2_11) +)$ ./a.out
>> Failed to read classid file: Object not found
>> br0: dummy0 dummy1
>> cache manager got update
>> br0: dummy0 dummy1
>> cache manager got update
>> br0: dummy0
>> cache manager got update
>> br0: dummy0
>> cache manager got update
>> br0:
>> cache manager got update
>> br0:
>> cache manager got update
>> br0: dummy0
>> cache manager got update
>> br0: dummy0
>> cache manager got update
>> br0: dummy0 dummy1
>> cache manager got update
>> br0: dummy0 dummy1
>>
>>
>>
>>
>> I am not sure, what you expect to see.
>>
>> Thomas
>
>
>
> --
> eGauge Systems LLC, http://egauge.net/, 1.877-EGAUGE1, fax 720.545.9768



-- 
eGauge Systems LLC, http://egauge.net/, 1.877-EGAUGE1, fax 720.545.9768



More information about the libnl mailing list