2010-10-02 17:54:43

by Jochen Friedrich

[permalink] [raw]
Subject: [Patch] iw: Implement set 4addr.

Signed-off-by: Jochen Friedrich <[email protected]>
---
interface.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/interface.c b/interface.c
index c092aa2..e6cca4f 100644
--- a/interface.c
+++ b/interface.c
@@ -365,3 +365,16 @@ COMMAND(set, type, "<type>",
NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_type,
"Set interface type/mode.\n"
IFACE_TYPES);
+
+static int handle_interface_4addr(struct nl80211_state *state,
+ struct nl_cb *cb,
+ struct nl_msg *msg,
+ int argc, char **argv)
+{
+ if (argc != 1)
+ return 1;
+ return parse_4addr_flag(argv[0], msg);
+}
+COMMAND(set, 4addr, "<on|off>",
+ NL80211_CMD_SET_INTERFACE, 0, CIB_NETDEV, handle_interface_4addr,
+ "Set interface 4addr (WDS) mode.\n");
--
1.7.1



2010-10-04 09:21:05

by Jochen Friedrich

[permalink] [raw]
Subject: Re: [Patch] iw: Implement set 4addr.

Hi Holger,

Am 04.10.2010 09:15, schrieb Holger Schurig:
>> + "Set interface 4addr (WDS) mode.\n");
> Hi Jochen !
>
> Do you know if this feature can also be used to operate an Ethernet-Bridge on
> on a WLAN client?
>
> I'd like to get something like this going, with eth0|wlan0 as a bridge, so
> that any protocol/port on the "DEVICE" is reachable from the network:
>
> +--------+ +------------+ +----+ +---------+
> | DEVICE +---+ eth0|wlan0 +---+ AP +---+ network |
> +--------+ +------------+ +----+ +---------+
> Linux 2.6.x
> w/ mac80211
>

Yes, that's the idea behind this. I'm using an OpenWRT based WLAN router
and a Debian client with the configuration below.

From my tests, it looks like

- b43legacy runs OK in this mode (tested on MN700).
- ath9k has some issues with the promisc mode (if DEVICE talks to
another AP client, the bridge might add the DEVICE MAC address to wlan0
as soon as AP sends the frame originating from DEVICE to the AP client).
- iwlagn sometimes looses the connection after a hw scan. I'm currently
wondering if this might be a problem of ath5k (my AP is a WGT634U) not
ignoring PM frames in non-4addr frame format. Unfortunately, WGT634U
builds are currently broken in OpenWRT, so I can't test more recent
ath5k versions without major efforts.

Thanks,
Jochen

# 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


2010-10-04 13:28:55

by Johannes Berg

[permalink] [raw]
Subject: Re: [Patch] iw: Implement set 4addr.

On Mon, 2010-10-04 at 15:02 +0200, Holger Schurig wrote:
> > Yes, that's the idea behind this. I'm using an OpenWRT based WLAN router
> > and a Debian client with the configuration below.
>
> Oh, I don't have much success so far.
>
> My setup is like this:
>
> Linux 2.6.35.4
> compat-wireless-2010-10-02, using
> ath5k from this
> iw from git with your patch

What's your AP? You need to enable the 4addr mode on the AP as well.

johannes


2010-10-04 12:52:30

by Holger Schurig

[permalink] [raw]
Subject: Re: [Patch] iw: Implement set 4addr.

> Yes, that's the idea behind this. I'm using an OpenWRT based WLAN router
> and a Debian client with the configuration below.

Oh, I don't have much success so far.

My setup is like this:

Linux 2.6.35.4
compat-wireless-2010-10-02, using
ath5k from this
iw from git with your patch

------------------------------------------
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

iface br0 inet static
address 192.168.233.197
netmask 255.255.255.0
bridge_ports eth0 wlan0
bridge_wait 0
bridge_fd 0
bridge_stp off
post-up iw wlan0 connect TEST key 0:99999

I also tried it with wpa_supplicant, again from git. The last part of the
/etc/network/interface file looked then like this:

wpa_iface wlan0
wpa_bridge br0
wpa-conf /etc/wpa_supplicant.conf
wpa-driver nl80211

... but in both cases, I didn't have much of success. I tried "tcpdump -i
wlan0 -p" (-p prevents promiscuous mode) and only saw ARP, but never an ARP
response.

I'll investigate further :-)

--
Homepage: http://www.holgerschurig.de

2010-10-04 07:06:16

by Holger Schurig

[permalink] [raw]
Subject: Re: [Patch] iw: Implement set 4addr.

> + "Set interface 4addr (WDS) mode.\n");

Hi Jochen !

Do you know if this feature can also be used to operate an Ethernet-Bridge on
on a WLAN client?

I'd like to get something like this going, with eth0|wlan0 as a bridge, so
that any protocol/port on the "DEVICE" is reachable from the network:

+--------+ +------------+ +----+ +---------+
| DEVICE +---+ eth0|wlan0 +---+ AP +---+ network |
+--------+ +------------+ +----+ +---------+
Linux 2.6.x
w/ mac80211

--
Homepage: http://www.holgerschurig.de