diff -Nur rt73-cvs-2007071503.orig/Module/Makefile rt73-cvs-2007071503/Module/Makefile
--- rt73-cvs-2007071503.orig/Module/Makefile	2007-07-02 23:13:49.000000000 +0200
+++ rt73-cvs-2007071503/Module/Makefile	2007-07-21 11:04:36.000000000 +0200
@@ -40,7 +40,7 @@
 
 
 MODULE_NAME := rt73
-IF_NAME :=     wlan*
+IF_NAME :=     wlan[0-9]
 
 FIRMWARES :=   rt73.bin
 FIRM_DIR :=    /lib/firmware
diff -Nur rt73-cvs-2007071503.orig/Module/rtmp_def.h rt73-cvs-2007071503/Module/rtmp_def.h
--- rt73-cvs-2007071503.orig/Module/rtmp_def.h	2007-07-14 20:02:29.000000000 +0200
+++ rt73-cvs-2007071503/Module/rtmp_def.h	2007-07-16 07:08:34.000000000 +0200
@@ -158,6 +158,7 @@
 #define fOP_STATUS_MAX_RETRY_ENABLED		0x00000800
 #define fOP_STATUS_RTS_PROTECTION_ENABLE	0x00001000
 #define fOP_STATUS_FIRMWARE_LOAD	0x00002000
+#define fOP_STATUS_FIXED_IBSS_BSSID		0x40000000
 
 //
 // Flags for Bulkflags control for bulk out data
diff -Nur rt73-cvs-2007071503.orig/Module/rtmp.h rt73-cvs-2007071503/Module/rtmp.h
--- rt73-cvs-2007071503.orig/Module/rtmp.h	2007-07-06 21:20:49.000000000 +0200
+++ rt73-cvs-2007071503/Module/rtmp.h	2007-07-16 07:08:34.000000000 +0200
@@ -1214,6 +1214,7 @@
 	UCHAR		MaxTxRate;				// RATE_1, RATE_2, RATE_5_5, RATE_11
 
 	UCHAR		Bssid[MAC_ADDR_LEN];
+	UCHAR		BssidIBSS[MAC_ADDR_LEN];
 	USHORT		BeaconPeriod;
 	CHAR		Ssid[MAX_LEN_OF_SSID];		// NOT NULL-terminated
 	UCHAR		SsidLen;					// the actual ssid length in used
@@ -3365,6 +3366,10 @@
 	IN	PRTMP_ADAPTER	pAd,
 	IN	PVOID			pBuf);
 
+INT	Set_IBSS_BSSID_Proc(
+	IN	PRTMP_ADAPTER	pAdapter, 
+	IN	PUCHAR			arg);
+
 #if 1
 INT RTMPIoctlSetAuth(
 	IN	PRTMP_ADAPTER	pAdapter,
diff -Nur rt73-cvs-2007071503.orig/Module/rtmp_info.c rt73-cvs-2007071503/Module/rtmp_info.c
--- rt73-cvs-2007071503.orig/Module/rtmp_info.c	2007-06-26 23:26:02.000000000 +0200
+++ rt73-cvs-2007071503/Module/rtmp_info.c	2007-07-16 07:08:34.000000000 +0200
@@ -148,6 +148,7 @@
 #ifdef DBG
 	{"Debug",						Set_Debug_Proc},
 #endif
+	{"IBSS_BSSID",					Set_IBSS_BSSID_Proc},
 	{NULL,}
 };
 
@@ -3942,6 +3943,42 @@
 }
 
 /*
+ * For Freifunk and similar mesh networks: a fixed BSSID
+ * is much better than the holy BSSID split wars commonly
+ * encountered if no fixed BSSID is used in bigger meshes.
+ * Usage: iwpriv wlan0 set IBSS_BSSID=d2:ca:ff:ee:ba:be
+ *        iwpriv wlan0 set IBSS_BSSID=off
+ */
+INT Set_IBSS_BSSID_Proc(
+	IN	PRTMP_ADAPTER	pAdapter, 
+	IN	PUCHAR		arg)
+{
+	int success = FALSE;
+	if (arg)
+	{
+		if (0 == strcmp("off", arg))
+		{
+			OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_FIXED_IBSS_BSSID);
+		}
+		else
+		{
+			UINT i;
+			for(i = 0; i < ETH_ALEN; i++)
+			{
+				int x = 0;
+				if (arg) sscanf(arg, "%x", &x);
+				pAdapter->PortCfg.BssidIBSS[i] = x;
+				arg = strchr(arg, ':');
+				if (arg) arg++;
+			}
+			OPSTATUS_SET_FLAG(pAdapter, fOP_STATUS_FIXED_IBSS_BSSID);
+		}
+		success = TRUE;
+	}
+	return success;
+}
+
+/*
 	==========================================================================
 	Description:
 		Set SSID
diff -Nur rt73-cvs-2007071503.orig/Module/sync.c rt73-cvs-2007071503/Module/sync.c
--- rt73-cvs-2007071503.orig/Module/sync.c	2007-03-21 05:44:27.000000000 +0100
+++ rt73-cvs-2007071503/Module/sync.c	2007-07-16 07:08:34.000000000 +0200
@@ -338,8 +338,15 @@
         memcpy(pAd->MlmeAux.Ssid, Ssid, SsidLen);
         pAd->MlmeAux.SsidLen           = SsidLen;
 
+	if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_FIXED_IBSS_BSSID))
+	{
         // generate a radom number as BSSID
         MacAddrRandomBssid(pAd, pAd->MlmeAux.Bssid);
+	}
+	else
+	{
+		memcpy(pAd->MlmeAux.Bssid, pAd->PortCfg.BssidIBSS, ETH_ALEN);
+	}
 
         Privacy = (pAd->PortCfg.WepStatus == Ndis802_11Encryption1Enabled) ||
                   (pAd->PortCfg.WepStatus == Ndis802_11Encryption2Enabled) ||
@@ -797,6 +804,9 @@
 		is_my_bssid = MAC_ADDR_EQUAL(Bssid, pAd->PortCfg.Bssid)? TRUE : FALSE;
 		is_my_ssid = SSID_EQUAL(Ssid, SsidLen, pAd->PortCfg.Ssid, pAd->PortCfg.SsidLen)? TRUE:FALSE;
 
+		// With a fixed IBSS BSSID, simply ignore all Beacons with another BSSID
+		if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_FIXED_IBSS_BSSID) && !is_my_bssid) return;
+
 		// ignore BEACON not for my SSID
 		if ((! is_my_ssid) && (! is_my_bssid))
 			return;
