Skip to content

Commit

Permalink
Merge branch 'master' of /home/cero1/src/openwrt
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Taht committed Mar 27, 2012
2 parents 448aef7 + 7bc411c commit 1c79002
Show file tree
Hide file tree
Showing 132 changed files with 2,208 additions and 3,184 deletions.
2 changes: 1 addition & 1 deletion package/hostap-driver/files/lib/wifi/hostap.sh
Expand Up @@ -211,7 +211,7 @@ enable_prism2() {
;;
wds|sta)
if eval "type wpa_supplicant_setup_vif" 2>/dev/null >/dev/null; then
wpa_supplicant_setup_vif "$vif" hostap || {
wpa_supplicant_setup_vif "$vif" wext || {
echo "enable_prism2($device): Failed to set up wpa_supplicant for interface $ifname" >&2
ifconfig "$ifname" down
continue
Expand Down
6 changes: 3 additions & 3 deletions package/hostapd/Makefile
Expand Up @@ -8,9 +8,9 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=hostapd
PKG_VERSION:=20111103
PKG_RELEASE:=3
PKG_REV:=6caaae1e48da247b21b54ea6001646597e35d9b1
PKG_VERSION:=20120326
PKG_RELEASE:=1
PKG_REV:=f4329aa2d08192640532b712936f5221580e9f8c

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
Expand Down
2 changes: 2 additions & 0 deletions package/hostapd/files/wpa_supplicant-full.config
Expand Up @@ -404,3 +404,5 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y
#LIBS_c += -lbfd -liberty -lz

NEED_80211_COMMON=y

CONFIG_IBSS_RSN=y
8 changes: 7 additions & 1 deletion package/hostapd/files/wpa_supplicant.sh
Expand Up @@ -3,6 +3,8 @@ wpa_supplicant_setup_vif() {
local driver="$2"
local key="$key"
local options="$3"
local freq=""
[ -n "$4" ] && freq="frequency=$4"

# wpa_supplicant should use wext for mac80211 cards
[ "$driver" = "mac80211" ] && driver='wext'
Expand All @@ -23,14 +25,15 @@ wpa_supplicant_setup_vif() {
config_set "$vif" bridge "$bridge"
}

local mode ifname wds
local mode ifname wds modestr=""
config_get mode "$vif" mode
config_get ifname "$vif" ifname
config_get_bool wds "$vif" wds 0
[ -z "$bridge" ] || [ "$mode" = ap ] || [ "$mode" = sta -a $wds -eq 1 ] || {
echo "wpa_supplicant_setup_vif($ifname): Refusing to bridge $mode mode interface"
return 1
}
[ "$mode" = "adhoc" ] && modestr="mode=1"

case "$enc" in
*none*)
Expand Down Expand Up @@ -59,6 +62,7 @@ wpa_supplicant_setup_vif() {
;;
*psk*)
key_mgmt='WPA-PSK'
[ "$mode" = "adhoc" -a "$driver" != "nl80211" ] && key_mgmt='WPA-NONE'
config_get_bool usepassphrase "$vif" usepassphrase 1
if [ "$usepassphrase" = "1" ]; then
passphrase="psk=\"${key}\""
Expand Down Expand Up @@ -123,11 +127,13 @@ wpa_supplicant_setup_vif() {
cat > /var/run/wpa_supplicant-$ifname.conf <<EOF
ctrl_interface=/var/run/wpa_supplicant-$ifname
network={
$modestr
scan_ssid=1
ssid="$ssid"
$bssid
key_mgmt=$key_mgmt
$proto
$freq
$ieee80211w
$passphrase
$pairwise
Expand Down
115 changes: 29 additions & 86 deletions package/hostapd/patches/100-pending_work.patch
@@ -1,6 +1,6 @@
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -1471,13 +1471,6 @@ static void handle_assoc_cb(struct hosta
@@ -1488,13 +1488,6 @@ static void handle_assoc_cb(struct hosta
int new_assoc = 1;
struct ieee80211_ht_capabilities ht_cap;

Expand All @@ -14,7 +14,7 @@
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_resp) :
sizeof(mgmt->u.assoc_resp))) {
printf("handle_assoc_cb(reassoc=%d) - too short payload "
@@ -1485,11 +1478,6 @@ static void handle_assoc_cb(struct hosta
@@ -1502,11 +1495,6 @@ static void handle_assoc_cb(struct hosta
return;
}

Expand All @@ -26,7 +26,7 @@
sta = ap_get_sta(hapd, mgmt->da);
if (!sta) {
printf("handle_assoc_cb: STA " MACSTR " not found\n",
@@ -1497,6 +1485,19 @@ static void handle_assoc_cb(struct hosta
@@ -1514,6 +1502,19 @@ static void handle_assoc_cb(struct hosta
return;
}

Expand All @@ -46,34 +46,33 @@
if (status != WLAN_STATUS_SUCCESS)
goto fail;

@@ -1812,6 +1813,9 @@ void ieee802_11_rx_from_unknown(struct h

sta = ap_get_sta(hapd, src);
if (sta && (sta->flags & WLAN_STA_ASSOC)) {
+ if (!hapd->conf->wds_sta)
+ return;
+
if (wds && !(sta->flags & WLAN_STA_WDS)) {
wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for "
"STA " MACSTR " (aid %u)",
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -181,6 +181,7 @@ struct i802_bss {
struct wpa_driver_nl80211_data *drv;
struct i802_bss *next;
int ifindex;
+ u8 addr[ETH_ALEN];
char ifname[IFNAMSIZ + 1];
char brname[IFNAMSIZ];
unsigned int beacon_set:1;
@@ -191,7 +192,6 @@ struct i802_bss {
struct wpa_driver_nl80211_data {
struct nl80211_global *global;
struct dl_list list;
- u8 addr[ETH_ALEN];
char phyname[32];
void *ctx;
int ifindex;
@@ -2482,7 +2482,7 @@ wpa_driver_nl80211_finish_drv_init(struc
return -1;
@@ -2588,10 +2588,10 @@ static int wpa_driver_nl80211_capa(struc
drv->data_tx_status = info.data_tx_status;

if (linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname,
- drv->addr))
+ bss->addr))
return -1;
/*
- * If poll command is supported mac80211 is new enough to
- * have everything we need to not need monitor interfaces.
+ * If poll command and tx status are supported, mac80211 is new enough
+ * to have everything we need to not need monitor interfaces.
*/
- drv->use_monitor = !info.poll_command_supported;
+ drv->use_monitor = !info.poll_command_supported || !info.data_tx_status;

if (nl80211_register_action_frames(drv) < 0) {
@@ -5176,8 +5176,8 @@ static int wpa_driver_nl80211_hapd_send_
if (drv->device_ap_sme && drv->use_monitor) {
/*
@@ -6267,8 +6267,8 @@ static int wpa_driver_nl80211_hapd_send_
pos = (u8 *) (hdr + 1);

if (qos) {
Expand All @@ -84,16 +83,7 @@
pos[1] = 0;
pos += 2;
}
@@ -6407,7 +6407,7 @@ static int i802_set_wds_sta(void *priv,
if (!if_nametoindex(name)) {
if (nl80211_create_iface(drv, name,
NL80211_IFTYPE_AP_VLAN,
- NULL, 1) < 0)
+ bss->addr, 1) < 0)
return -1;
if (bridge_ifname &&
linux_br_add_if(drv->global->ioctl_sock,
@@ -6417,6 +6417,10 @@ static int i802_set_wds_sta(void *priv,
@@ -7533,6 +7533,10 @@ static int i802_set_wds_sta(void *priv,
linux_set_iface_flags(drv->global->ioctl_sock, name, 1);
return i802_set_sta_vlan(priv, addr, name, 0);
} else {
Expand All @@ -104,36 +94,7 @@
i802_set_sta_vlan(priv, addr, bss->ifname, 0);
return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
name);
@@ -6625,7 +6629,7 @@ static int nl80211_addr_in_use(struct nl
struct wpa_driver_nl80211_data *drv;
dl_list_for_each(drv, &global->interfaces,
struct wpa_driver_nl80211_data, list) {
- if (os_memcmp(addr, drv->addr, ETH_ALEN) == 0)
+ if (os_memcmp(addr, drv->first_bss.addr, ETH_ALEN) == 0)
return 1;
}
return 0;
@@ -6640,9 +6644,9 @@ static int nl80211_p2p_interface_addr(st
if (!drv->global)
return -1;

- os_memcpy(new_addr, drv->addr, ETH_ALEN);
+ os_memcpy(new_addr, drv->first_bss.addr, ETH_ALEN);
for (idx = 0; idx < 64; idx++) {
- new_addr[0] = drv->addr[0] | 0x02;
+ new_addr[0] = drv->first_bss.addr[0] | 0x02;
new_addr[0] ^= idx << 2;
if (!nl80211_addr_in_use(drv->global, new_addr))
break;
@@ -6745,6 +6749,7 @@ static int wpa_driver_nl80211_if_add(voi
os_free(new_bss);
return -1;
}
+ memcpy(new_bss->addr, addr ? addr : if_addr, ETH_ALEN);
os_strlcpy(new_bss->ifname, ifname, IFNAMSIZ);
new_bss->ifindex = ifidx;
new_bss->drv = drv;
@@ -6775,7 +6780,12 @@ static int wpa_driver_nl80211_if_remove(
@@ -7900,7 +7904,12 @@ static int wpa_driver_nl80211_if_remove(
if (ifindex <= 0)
return -1;

Expand All @@ -146,7 +107,7 @@
if (bss->added_if_into_bridge) {
if (linux_br_del_if(drv->global->ioctl_sock, bss->brname,
bss->ifname) < 0)
@@ -6789,13 +6799,6 @@ static int wpa_driver_nl80211_if_remove(
@@ -7914,13 +7923,6 @@ static int wpa_driver_nl80211_if_remove(
"bridge %s: %s",
bss->brname, strerror(errno));
}
Expand All @@ -160,21 +121,3 @@

if (bss != &drv->first_bss) {
struct i802_bss *tbss;
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -776,7 +776,14 @@ void wpa_receive(struct wpa_authenticato
}

if (sm->wpa == WPA_VERSION_WPA2) {
- if (key->type != EAPOL_KEY_TYPE_RSN) {
+ if (key->type == EAPOL_KEY_TYPE_WPA) {
+ /*
+ * Some deployed station implementations seem to send
+ * msg 4/4 with incorrect type value in WPA2 mode.
+ */
+ wpa_printf(MSG_DEBUG, "Workaround: Allow EAPOL-Key "
+ "with unexpected WPA type in RSN mode");
+ } else if (key->type != EAPOL_KEY_TYPE_RSN) {
wpa_printf(MSG_DEBUG, "Ignore EAPOL-Key with "
"unexpected type %d in RSN mode",
key->type);
60 changes: 60 additions & 0 deletions package/hostapd/patches/300-nl80211_multicall_fixes.patch
@@ -0,0 +1,60 @@
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2918,6 +2918,7 @@ static void * wpa_driver_nl80211_init(vo
drv->monitor_sock = -1;
drv->eapol_tx_sock = -1;
drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED;
+ drv->nlmode = NL80211_IFTYPE_STATION;

if (wpa_driver_nl80211_init_nl(drv)) {
os_free(drv);
@@ -3232,17 +3233,12 @@ static void wpa_driver_nl80211_send_rfki
wpa_supplicant_event(timeout_ctx, EVENT_INTERFACE_DISABLED, NULL);
}

-
static int
-wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
+wpa_driver_nl80211_finish_drv_init_sta(struct wpa_driver_nl80211_data *drv,
+ int *send_rfkill_event)
{
struct i802_bss *bss = &drv->first_bss;
- int send_rfkill_event = 0;

- drv->ifindex = if_nametoindex(bss->ifname);
- drv->first_bss.ifindex = drv->ifindex;
-
-#ifndef HOSTAPD
/*
* Make sure the interface starts up in station mode unless this is a
* dynamically added interface (e.g., P2P) that was already configured
@@ -3261,7 +3257,7 @@ wpa_driver_nl80211_finish_drv_init(struc
"interface '%s' due to rfkill",
bss->ifname);
drv->if_disabled = 1;
- send_rfkill_event = 1;
+ *send_rfkill_event = 1;
} else {
wpa_printf(MSG_ERROR, "nl80211: Could not set "
"interface '%s' UP", bss->ifname);
@@ -3271,7 +3267,19 @@ wpa_driver_nl80211_finish_drv_init(struc

netlink_send_oper_ifla(drv->global->netlink, drv->ifindex,
1, IF_OPER_DORMANT);
-#endif /* HOSTAPD */
+}
+
+static int
+wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv)
+{
+ struct i802_bss *bss = &drv->first_bss;
+ int send_rfkill_event = 0;
+
+ drv->ifindex = if_nametoindex(bss->ifname);
+ drv->first_bss.ifindex = drv->ifindex;
+
+ if (drv->nlmode == NL80211_IFTYPE_STATION)
+ wpa_driver_nl80211_finish_drv_init_sta(drv, &send_rfkill_event);

if (wpa_driver_nl80211_capa(drv))
return -1;
37 changes: 0 additions & 37 deletions package/hostapd/patches/300-scan_ssid.patch

This file was deleted.

0 comments on commit 1c79002

Please sign in to comment.