Changeset 1732
- Timestamp:
- 09/24/06 23:06:25 (2 years ago)
- Files:
-
- trunk/net80211/ieee80211_crypto.c (modified) (1 diff)
- trunk/net80211/ieee80211_crypto_ccmp.c (modified) (1 diff)
- trunk/net80211/ieee80211_node.c (modified) (1 diff)
- trunk/net80211/ieee80211_var.h (modified) (1 diff)
- trunk/net80211/ieee80211_wireless.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/net80211/ieee80211_crypto.c
r1721 r1732 612 612 /* 613 613 * Validate and strip privacy headers (and trailer) for a 614 * received frame that has the WEP/Privacybit set.614 * received frame that has the Protected Frame bit set. 615 615 */ 616 616 struct ieee80211_key * trunk/net80211/ieee80211_crypto_ccmp.c
r1721 r1732 241 241 if (IEEE80211_QOS_HAS_SEQ(wh)) 242 242 tid = ((struct ieee80211_qosframe *)wh)->i_qos[0] & IEEE80211_QOS_TID; 243 /* NB: assume IEEE E80211_WEP_MINLEN covers the extended IV */243 /* NB: assume IEEE80211_WEP_MINLEN covers the extended IV */ 244 244 pn = READ_6(ivp[0], ivp[1], ivp[4], ivp[5], ivp[6], ivp[7]); 245 245 if (pn <= k->wk_keyrsc[tid]) { trunk/net80211/ieee80211_node.c
r1721 r1732 422 422 return 0; 423 423 } else { 424 /* XXX does this mean privacy is supported or required? */ 424 /* Reference: IEEE802.11 7.3.1.4 425 * This means that the data confidentiality service is required 426 * for all frames exchanged with this STA in IBSS and for all 427 * frames exchanged within the entire BSS otherwise 428 */ 429 425 430 if (ni->ni_capinfo & IEEE80211_CAPINFO_PRIVACY) 426 431 return 0; trunk/net80211/ieee80211_var.h
r1713 r1732 397 397 MALLOC_DECLARE(M_80211_VAP); 398 398 399 #define IEEE80211_ADDR_NULL(a1) (memcmp(a1, "\x00\x00\x00\x00\x00\x00", \ 400 IEEE80211_ADDR_LEN) == 0) 401 #define IEEE80211_ADDR_EQ(a1,a2) (memcmp(a1,a2,IEEE80211_ADDR_LEN) == 0) 402 #define IEEE80211_ADDR_COPY(dst,src) memcpy(dst,src,IEEE80211_ADDR_LEN) 399 #define IEEE80211_ADDR_NULL(a1) (memcmp(a1, "\x00\x00\x00\x00\x00\x00", \ 400 IEEE80211_ADDR_LEN) == 0) 401 #define IEEE80211_ADDR_EQ(a1, a2) (memcmp(a1, a2, IEEE80211_ADDR_LEN) == 0) 402 #define IEEE80211_ADDR_COPY(dst, src) memcpy(dst, src, IEEE80211_ADDR_LEN) 403 #define IEEE80211_ADDR_SET_NULL(dst) memset(dst, 0, IEEE80211_ADDR_LEN) 403 404 404 405 /* ic_flags */ trunk/net80211/ieee80211_wireless.c
r1723 r1732 518 518 struct sockaddr *ap_addr, char *extra) 519 519 { 520 static const u_int8_t zero_bssid[IEEE80211_ADDR_LEN];521 static const u_int8_t broadcast_bssid[IEEE80211_ADDR_LEN] =522 "\xff\xff\xff\xff\xff\xff";523 520 struct ieee80211vap *vap = dev->priv; 524 521 … … 540 537 * anything else specifies a particular AP. 541 538 */ 542 if (IEEE80211_ADDR_EQ(&ap_addr->sa_data, zero_bssid)) 543 vap->iv_flags &= ~IEEE80211_F_DESBSSID; 544 else { 539 vap->iv_flags &= ~IEEE80211_F_DESBSSID; 540 if (!IEEE80211_ADDR_NULL(&ap_addr->sa_data)) { 541 if (!IEEE80211_ADDR_EQ(vap->iv_des_bssid, (u_int8_t*) "\xff\xff\xff\xff\xff\xff")) 542 vap->iv_flags |= IEEE80211_F_DESBSSID; 543 545 544 IEEE80211_ADDR_COPY(vap->iv_des_bssid, &ap_addr->sa_data); 546 if (IEEE80211_ADDR_EQ(vap->iv_des_bssid, broadcast_bssid))547 vap->iv_flags &= ~IEEE80211_F_DESBSSID;548 else549 vap->iv_flags |= IEEE80211_F_DESBSSID;550 545 if (IS_UP_AUTO(vap)) 551 546 ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); … … 563 558 IEEE80211_ADDR_COPY(&ap_addr->sa_data, vap->iv_des_bssid); 564 559 else { 565 static const u_int8_t zero_bssid[IEEE80211_ADDR_LEN];566 560 if (vap->iv_state == IEEE80211_S_RUN) 567 561 if (vap->iv_opmode != IEEE80211_M_WDS) … … 570 564 IEEE80211_ADDR_COPY(&ap_addr->sa_data, vap->wds_mac); 571 565 else 572 IEEE80211_ADDR_ COPY(&ap_addr->sa_data, zero_bssid);566 IEEE80211_ADDR_SET_NULL(&ap_addr->sa_data); 573 567 } 574 568 ap_addr->sa_family = ARPHRD_ETHER;
