nl80211: fix interface address assignment
authorJohannes Berg <johannes.berg@intel.com>
Fri, 15 Jul 2011 09:05:19 +0000 (12:05 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 15 Jul 2011 09:05:19 +0000 (12:05 +0300)
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>
src/drivers/driver_nl80211.c

index d680ac2..d0f256c 100644 (file)
@@ -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 */