2010-08-15 17:11:08

by Jochen Friedrich

[permalink] [raw]
Subject: 4addr mode promisc problem

Hi,

in the current implementation of mac80211 4addr mode, bridging a
wireless interface to a wired one doesn't work as expected due to
promisc mode forwarding frames sent to a different "AP" to higher
layers...

Given this setup:

A -wireless link- AP -4addr mode link- B -ethernet- C

If I now ping C from A (all ARP entries are already set up), I get
exactly one response back.

This is what's happening:

A sends echo request to AP:
Frame Addr1=AP, Addr2=A, Addr3=C
AP adds CAM entry A=wlan0
B adds CAM entry A=wlan0.sta1

AP sends echo request to B
Frame Addr1=B, Addr2=AP, Addr3=C, Addr4=A

B doesn't have CAM entry for C, forwards echo request to eth0.

C replies with echo reply on eth0.
B adds CAM entry C=eth0

B hat CAM entry of A, sends echo reply to wlan0.sta1
Frame Addr1=AP, Addr2=B, Addr3=A, Addr4=C

AP sends echo reply to A
Frame Addr1=A, Addr2=AP, Addr3=C
B updates CAM entry C=wlan0.sta1

Here the problem happens. B receives the frame from AP to A. It
can't decrypt the frame but it still updates the CAM entry and any
future packet from A to C won't be forwarded to eth0 anymore.

IMHO, promisc mode on an interface with 4addr mode should only
affect addr3 processing, but not addr1. The current behaviour looks
like a bug to me.

Config on B (needs iw patch sent by me two weeks ago):

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet manual
pre-up iw wlan0 set 4addr on

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet dhcp
bridge_ports wlan0 eth0
bridge_fd 0
bridge_stp off
wpa-ssid <my ssid>
wpa-psk <my password>
wpa-bridge br0
wpa-iface wlan0

Thanks,
Jochen