Browse Source

nl80211: fix interface address assignment

When a new interface is created and already has a separate MAC address
assigned by the kernel, then we need to use that address, not just when
we've created a locally administered address.

This fixes use_p2p_group_interface=1 for iwlagn as it already makes
mac80211 assign an address for a second interface since the hardware has
two addresses assigned.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg 13 years ago
parent
commit
f67eeb5c32
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/drivers/driver_nl80211.c

+ 1 - 1
src/drivers/driver_nl80211.c

@@ -6005,8 +6005,8 @@ static int wpa_driver_nl80211_if_add(void *priv, enum wpa_driver_if_type type,
 				nl80211_remove_iface(drv, ifidx);
 				return -1;
 			}
-			os_memcpy(if_addr, new_addr, ETH_ALEN);
 		}
+		os_memcpy(if_addr, new_addr, ETH_ALEN);
 	}
 #endif /* CONFIG_P2P */