Stephen Hemminger
2007-Apr-18 12:33 UTC
[Bridge] bridging bluetooth bnep devices with kernel 2.6.6-*
2.6.6 got too picky about multiple interfaces with the same
address. This patch has been already integrated for later releases.
diff -Nru a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
--- a/net/bridge/br_fdb.c Mon May 10 13:45:50 2004
+++ b/net/bridge/br_fdb.c Mon May 10 13:45:50 2004
@@ -277,18 +277,18 @@
if (!memcmp(fdb->addr.addr, addr, ETH_ALEN)) {
/* attempt to update an entry for a local interface */
if (unlikely(fdb->is_local)) {
- if (is_local)
- printk(KERN_INFO "%s: attempt to add"
- " interface with same source address.\n",
- source->dev->name);
- else if (net_ratelimit())
- printk(KERN_WARNING "%s: received packet with "
- " own address as source address\n",
- source->dev->name);
- ret = -EEXIST;
+ /* it is okay to have multiple ports with same
+ * address, just don't allow to be spoofed.
+ */
+ if (!is_local) {
+ if (net_ratelimit())
+ printk(KERN_WARNING "%s: received packet with "
+ " own address as source address\n",
+ source->dev->name);
+ ret = -EEXIST;
+ }
goto out;
}
-
if (likely(!fdb->is_static || is_local)) {
/* move to end of age list */
Diego Liziero
2007-Apr-18 12:33 UTC
[Bridge] bridging bluetooth bnep devices with kernel 2.6.6-*
It seems that switching from 2.4.x to 2.6.x
caused the bridge of more than a bnep (Bluetooth)
device to stop to work.
Details on this kind of bridging at:
http://www.cs.ucla.edu/~cclljj/interest/notes/bluez/pand_bridge_nap.html
Note that the MAC address of all these devices is the same,
as they belong to the same bluetooth device.
# ifconfig bnep0
bnep0 Link encap:Ethernet HWaddr 00:02:72:80:1B:3B
inet6 addr: fe80::202:72ff:fe80:1b3b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:537 errors:0 dropped:0 overruns:0 frame:0
TX packets:138 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:69267 (67.6 KiB) TX bytes:24779 (24.1 KiB)
# ifconfig bnep1
bnep1 Link encap:Ethernet HWaddr 00:02:72:80:1B:3B
inet6 addr: fe80::202:72ff:fe80:1b3b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5094 (4.9 KiB) TX bytes:356 (356.0 b)
What I did is:
# brctl addbr pan0
# ifconfig pan0 192.168.111.1
# brctl setfd pan0 0
# brctl stp pan0 disable
# brctl addif pan0 bnep0
# ifconfig bnep0 0.0.0.0
And the first bluetooth link works fine,
but when I try to add a second link I get:
# brctl addif pan0 bnep1
can't add bnep1 to bridge pan0: File exists
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
if I try to remove bnep1:
# brctl delif pan0 bnep1
device bnep1 is not a slave of pan0
With kernel 2.4.x instead everything works.
Any suggestion?
Regards,
Diego.