[PATCH] Changing peer address for WDS interfaces

Pavel Roskin proski at gnu.org
Mon Nov 28 22:20:07 EST 2005

It may be useful to change the peer address for WDS interfaces.  I found
this functionality in the current MadWifi driver and I thought maybe
hostap could have this feature as well.

The "Access Point" value reported by iwconfig for WDS interfaces is the
MAC address of the peer.  iwconfig can set that value as well.  This
patch makes it possible to set the peer address of WDS interfaces using

Since WDS is implemented in software, there should be no need to reset
the card.

The code could have some protection against duplicate addresses, but I
think it would bloat the code and inconvenience users e.g. when peer
addresses are swapped between two WDS interfaces.

Signed-off-by: Pavel Roskin <proski at gnu.org>

diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 2617d70..8a73444 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -713,6 +713,11 @@ static int prism2_ioctl_siwap(struct net
 	iface = netdev_priv(dev);
 	local = iface->local;
+	if (iface->type == HOSTAP_INTERFACE_WDS) {
+		memcpy(iface->u.wds.remote_addr, &ap_addr->sa_data, ETH_ALEN);
+		return 0;
+	}
 	memcpy(local->preferred_ap, &ap_addr->sa_data, ETH_ALEN);
 	if (local->host_roaming == 1 && local->iw_mode == IW_MODE_INFRA) {

Pavel Roskin

More information about the HostAP mailing list