Changeset 1732

Show
Ignore:
Timestamp:
09/24/06 23:06:25 (2 years ago)
Author:
mentor
Message:

Updates some comments: 2 corrections, 1 comment about Capability Information meaning.
Add a .11 Address modification primitive (IEEE80211_ADDR_SET_NULL).
Fuck around with the implementaiton of some ioctls.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/net80211/ieee80211_crypto.c

    r1721 r1732  
    612612/* 
    613613 * Validate and strip privacy headers (and trailer) for a 
    614  * received frame that has the WEP/Privacy bit set. 
     614 * received frame that has the Protected Frame bit set. 
    615615 */ 
    616616struct ieee80211_key * 
  • trunk/net80211/ieee80211_crypto_ccmp.c

    r1721 r1732  
    241241        if (IEEE80211_QOS_HAS_SEQ(wh))  
    242242                tid = ((struct ieee80211_qosframe *)wh)->i_qos[0] & IEEE80211_QOS_TID; 
    243         /* NB: assume IEEEE80211_WEP_MINLEN covers the extended IV */  
     243        /* NB: assume IEEE80211_WEP_MINLEN covers the extended IV */  
    244244        pn = READ_6(ivp[0], ivp[1], ivp[4], ivp[5], ivp[6], ivp[7]); 
    245245        if (pn <= k->wk_keyrsc[tid]) { 
  • trunk/net80211/ieee80211_node.c

    r1721 r1732  
    422422                        return 0; 
    423423        } 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 
    425430                if (ni->ni_capinfo & IEEE80211_CAPINFO_PRIVACY) 
    426431                        return 0; 
  • trunk/net80211/ieee80211_var.h

    r1713 r1732  
    397397MALLOC_DECLARE(M_80211_VAP); 
    398398 
    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) 
    403404 
    404405/* ic_flags */ 
  • trunk/net80211/ieee80211_wireless.c

    r1723 r1732  
    518518        struct sockaddr *ap_addr, char *extra) 
    519519{ 
    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"; 
    523520        struct ieee80211vap *vap = dev->priv; 
    524521 
     
    540537         * anything else specifies a particular AP. 
    541538         */ 
    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                 
    545544                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                 else  
    549                         vap->iv_flags |= IEEE80211_F_DESBSSID; 
    550545                if (IS_UP_AUTO(vap)) 
    551546                        ieee80211_new_state(vap, IEEE80211_S_SCAN, 0); 
     
    563558                IEEE80211_ADDR_COPY(&ap_addr->sa_data, vap->iv_des_bssid); 
    564559        else { 
    565                 static const u_int8_t zero_bssid[IEEE80211_ADDR_LEN]; 
    566560                if (vap->iv_state == IEEE80211_S_RUN) 
    567561                        if (vap->iv_opmode != IEEE80211_M_WDS)  
     
    570564                                IEEE80211_ADDR_COPY(&ap_addr->sa_data, vap->wds_mac); 
    571565                else 
    572                         IEEE80211_ADDR_COPY(&ap_addr->sa_data, zero_bssid); 
     566                        IEEE80211_ADDR_SET_NULL(&ap_addr->sa_data); 
    573567        } 
    574568        ap_addr->sa_family = ARPHRD_ETHER;