summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2009-03-26 20:34:55 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2009-03-26 20:34:55 +0000
commitfdbea3cef9942c0516cd0727dfa9709cd730d0d8 (patch)
treedbc6737f90fbe3812a3f697a3fa08b30574c133e
parent4eacc26c475f34d24c56705a1e685afac6a3cb89 (diff)
sync with 802.11w draft 8.0.
the SA Query Transaction Identifier field is now a 16-bit non-negative counter value instead of a 128-bit random value.
-rw-r--r--sys/net80211/ieee80211_input.c10
-rw-r--r--sys/net80211/ieee80211_node.h4
-rw-r--r--sys/net80211/ieee80211_output.c8
-rw-r--r--sys/net80211/ieee80211_proto.c6
4 files changed, 15 insertions, 13 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index 15bed1b74cf..6e8e0aae021 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_input.c,v 1.110 2009/03/06 18:35:02 damien Exp $ */
+/* $OpenBSD: ieee80211_input.c,v 1.111 2009/03/26 20:34:54 damien Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
@@ -2580,7 +2580,7 @@ ieee80211_recv_sa_query_req(struct ieee80211com *ic, struct mbuf *m,
ether_sprintf(ni->ni_macaddr)));
return;
}
- if (m->m_len < sizeof(*wh) + 18) {
+ if (m->m_len < sizeof(*wh) + 4) {
DPRINTF(("frame too short\n"));
return;
}
@@ -2590,7 +2590,7 @@ ieee80211_recv_sa_query_req(struct ieee80211com *ic, struct mbuf *m,
/* MLME-SAQuery.indication */
/* save Transaction Identifier for SA Query Response */
- memcpy(ni->ni_sa_query_trid, &frm[2], 16);
+ ni->ni_sa_query_trid = LE_READ_2(&frm[2]);
/* MLME-SAQuery.response */
IEEE80211_SEND_ACTION(ic, ni, IEEE80211_CATEG_SA_QUERY,
@@ -2617,7 +2617,7 @@ ieee80211_recv_sa_query_resp(struct ieee80211com *ic, struct mbuf *m,
ether_sprintf(ni->ni_macaddr)));
return;
}
- if (m->m_len < sizeof(*wh) + 18) {
+ if (m->m_len < sizeof(*wh) + 4) {
DPRINTF(("frame too short\n"));
return;
}
@@ -2625,7 +2625,7 @@ ieee80211_recv_sa_query_resp(struct ieee80211com *ic, struct mbuf *m,
frm = (const u_int8_t *)&wh[1];
/* check that Transaction Identifier matches */
- if (memcmp(&frm[2], ni->ni_sa_query_trid, 16) != 0) {
+ if (ni->ni_sa_query_trid != LE_READ_2(&frm[2])) {
DPRINTF(("transaction identifier does not match\n"));
return;
}
diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h
index dd259bd129c..380baedb583 100644
--- a/sys/net80211/ieee80211_node.h
+++ b/sys/net80211/ieee80211_node.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.h,v 1.39 2009/01/28 18:55:18 damien Exp $ */
+/* $OpenBSD: ieee80211_node.h,v 1.40 2009/03/26 20:34:54 damien Exp $ */
/* $NetBSD: ieee80211_node.h,v 1.9 2004/04/30 22:57:32 dyoung Exp $ */
/*-
@@ -213,7 +213,7 @@ struct ieee80211_node {
int ni_port_valid;
/* SA Query */
- u_int8_t ni_sa_query_trid[16];
+ u_int16_t ni_sa_query_trid;
struct timeout ni_sa_query_to;
int ni_sa_query_count;
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 32487bfa786..f4a2911220f 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_output.c,v 1.84 2009/03/06 18:35:02 damien Exp $ */
+/* $OpenBSD: ieee80211_output.c,v 1.85 2009/03/26 20:34:54 damien Exp $ */
/* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */
/*-
@@ -1553,14 +1553,16 @@ ieee80211_get_sa_query(struct ieee80211com *ic, struct ieee80211_node *ni,
struct mbuf *m;
u_int8_t *frm;
- m = ieee80211_getmgmt(M_DONTWAIT, MT_DATA, 18);
+ m = ieee80211_getmgmt(M_DONTWAIT, MT_DATA, 4);
if (m == NULL)
return NULL;
frm = mtod(m, u_int8_t *);
*frm++ = IEEE80211_CATEG_SA_QUERY;
*frm++ = action; /* ACTION_SA_QUERY_REQ/RESP */
- memcpy(frm, ni->ni_sa_query_trid, 16);
+ LE_WRITE_2(frm, ni->ni_sa_query_trid); frm += 2;
+
+ m->m_pkthdr.len = m->m_len = frm - mtod(m, u_int8_t *);
return m;
}
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index a53a8da33ba..d8db4dc8f31 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_proto.c,v 1.39 2009/01/28 18:55:18 damien Exp $ */
+/* $OpenBSD: ieee80211_proto.c,v 1.40 2009/03/26 20:34:54 damien Exp $ */
/* $NetBSD: ieee80211_proto.c,v 1.8 2004/04/30 23:58:20 dyoung Exp $ */
/*-
@@ -542,8 +542,8 @@ ieee80211_sa_query_request(struct ieee80211com *ic, struct ieee80211_node *ni)
ni->ni_flags &= ~IEEE80211_NODE_SA_QUERY_FAILED;
ni->ni_sa_query_count = 0;
}
- /* generate random Transaction Identifier */
- arc4random_buf(ni->ni_sa_query_trid, 16);
+ /* generate new Transaction Identifier */
+ ni->ni_sa_query_trid++;
/* send SA Query Request */
IEEE80211_SEND_ACTION(ic, ni, IEEE80211_CATEG_SA_QUERY,