aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnton Nayshtut <qca_antonn@qca.qualcomm.com>2015-11-10 15:51:07 +0200
committerGerrit - the friendly Code Review server <code-review@localhost>2015-12-01 08:14:52 -0800
commitcb7ecf9c78c96e154fb533510e260a259e5fad28 (patch)
tree9bdb617173923d2728a478e1d2a53cb2a114b903 /src
parent87704cf971d272347fa196c23e2574f0faa90a3c (diff)
downloadandroid_external_wpa_supplicant_8-cb7ecf9c78c96e154fb533510e260a259e5fad28.tar.gz
android_external_wpa_supplicant_8-cb7ecf9c78c96e154fb533510e260a259e5fad28.tar.bz2
android_external_wpa_supplicant_8-cb7ecf9c78c96e154fb533510e260a259e5fad28.zip
FST: Make FST peer connection check more permissive in hostapd
Modify the FST peer connection check so it won't skip peers without MB IEs making it more permissive for peers that didn't provide MB IEs during association request. This can be helpful, e.g., in cases where a STA's interface connected before it was added to the FST group. This allows the AP to receive FST Action frames and initiate session with a STA via STA's interface that doesn't expose MB IEs. The adjusted FST protocol is still safe, as it protects itself in many other ways (checking band info and it's accordance to the interfaces, Setup IDs, connection states of the interfaces involved, etc.) effectively avoiding all types of invalid situations. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Git-commit: b47d05aa458ed7c7dfbfe09fc2a2af1f2fee7fc7 Git-repo : git://w1.fi/srv/git/hostap.git CRs-Fixed: 945518 Change-Id: Ie1a94890d55dcd7027947cedd4313eddebe3d487
Diffstat (limited to 'src')
-rw-r--r--src/fst/fst.c2
-rw-r--r--src/fst/fst_ctrl_iface.c2
-rw-r--r--src/fst/fst_group.c3
-rw-r--r--src/fst/fst_iface.c7
-rw-r--r--src/fst/fst_iface.h3
-rw-r--r--src/fst/fst_session.c9
6 files changed, 16 insertions, 10 deletions
diff --git a/src/fst/fst.c b/src/fst/fst.c
index 28808702..40430e29 100644
--- a/src/fst/fst.c
+++ b/src/fst/fst.c
@@ -160,7 +160,7 @@ void fst_global_del_ctrl(struct fst_ctrl_handle *h)
void fst_rx_action(struct fst_iface *iface, const struct ieee80211_mgmt *mgmt,
size_t len)
{
- if (fst_iface_is_connected(iface, mgmt->sa))
+ if (fst_iface_is_connected(iface, mgmt->sa, FALSE))
fst_session_on_action_rx(iface, mgmt, len);
else
wpa_printf(MSG_DEBUG,
diff --git a/src/fst/fst_ctrl_iface.c b/src/fst/fst_ctrl_iface.c
index d0907188..98ece9fb 100644
--- a/src/fst/fst_ctrl_iface.c
+++ b/src/fst/fst_ctrl_iface.c
@@ -749,7 +749,7 @@ int fst_ctrl_iface_mb_info(const u8 *addr, char *buf, size_t buflen)
foreach_fst_group(g) {
foreach_fst_group_iface(g, f) {
- if (fst_iface_is_connected(f, addr)) {
+ if (fst_iface_is_connected(f, addr, TRUE)) {
ret += print_band(num++, f, addr,
buf + ret, buflen - ret);
}
diff --git a/src/fst/fst_group.c b/src/fst/fst_group.c
index f2cd3296..e0c055f0 100644
--- a/src/fst/fst_group.c
+++ b/src/fst/fst_group.c
@@ -219,7 +219,8 @@ fst_group_get_new_iface_by_mbie_and_band_id(struct fst_group *g,
fst_mbie_get_peer_addr(mbie);
if (peer_addr &&
- fst_iface_is_connected(iface, peer_addr) &&
+ fst_iface_is_connected(iface, peer_addr,
+ TRUE) &&
band_id == fst_iface_get_band_id(iface)) {
os_memcpy(iface_peer_addr, peer_addr,
ETH_ALEN);
diff --git a/src/fst/fst_iface.c b/src/fst/fst_iface.c
index 5a92d2c3..35e83cb7 100644
--- a/src/fst/fst_iface.c
+++ b/src/fst/fst_iface.c
@@ -49,12 +49,13 @@ void fst_iface_delete(struct fst_iface *i)
}
-Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr)
+Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr,
+ Boolean mb_only)
{
struct fst_get_peer_ctx *ctx;
- const u8 *a = fst_iface_get_peer_first(iface, &ctx, TRUE);
+ const u8 *a = fst_iface_get_peer_first(iface, &ctx, mb_only);
- for (; a != NULL; a = fst_iface_get_peer_next(iface, &ctx, TRUE))
+ for (; a != NULL; a = fst_iface_get_peer_next(iface, &ctx, mb_only))
if (os_memcmp(addr, a, ETH_ALEN) == 0)
return TRUE;
diff --git a/src/fst/fst_iface.h b/src/fst/fst_iface.h
index 4670d894..0eb27325 100644
--- a/src/fst/fst_iface.h
+++ b/src/fst/fst_iface.h
@@ -123,7 +123,8 @@ static inline const u8 * fst_iface_get_peer_next(struct fst_iface *i,
return i->iface_obj.get_peer_next(i->iface_obj.ctx, ctx, mb_only);
}
-Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr);
+Boolean fst_iface_is_connected(struct fst_iface *iface, const u8 *addr,
+ Boolean mb_only);
void fst_iface_attach_mbie(struct fst_iface *i, struct wpabuf *mbie);
enum mb_band_id fst_iface_get_band_id(struct fst_iface *i);
diff --git a/src/fst/fst_session.c b/src/fst/fst_session.c
index 55fa6949..f804b122 100644
--- a/src/fst/fst_session.c
+++ b/src/fst/fst_session.c
@@ -863,13 +863,15 @@ int fst_session_initiate_setup(struct fst_session *s)
return -EINVAL;
}
- if (!fst_iface_is_connected(s->data.old_iface, s->data.old_peer_addr)) {
+ if (!fst_iface_is_connected(s->data.old_iface, s->data.old_peer_addr,
+ FALSE)) {
fst_printf_session(s, MSG_ERROR,
"The preset old peer address is not connected");
return -EINVAL;
}
- if (!fst_iface_is_connected(s->data.new_iface, s->data.new_peer_addr)) {
+ if (!fst_iface_is_connected(s->data.new_iface, s->data.new_peer_addr,
+ FALSE)) {
fst_printf_session(s, MSG_ERROR,
"The preset new peer address is not connected");
return -EINVAL;
@@ -966,7 +968,8 @@ int fst_session_respond(struct fst_session *s, u8 status_code)
return -EINVAL;
}
- if (!fst_iface_is_connected(s->data.old_iface, s->data.old_peer_addr)) {
+ if (!fst_iface_is_connected(s->data.old_iface,
+ s->data.old_peer_addr, FALSE)) {
fst_printf_session(s, MSG_ERROR,
"The preset peer address is not in the peer list");
return -EINVAL;