Ticket #1281: 112-fixed_ibss_bssid.patch

File 112-fixed_ibss_bssid.patch, 1.7 KB (added by mathias, 11 years ago)
  • madwifi-ng-r1696-20060730

    This patch fixes a bug in net80211/ieee80211_wireless.c preventing 
    the user from setting a certain BSSID by 
    "iwconfig athX ap XX:XX:XX:XX:XX:XX". 
    It furthermore prevents merging to another IBSS in ad-hoc mode 
    if a BSSID was set previously by the above command.
    It was tested with the snapshot madwifi-ng-r1696-20060730.
    
    Signed-off-by: Joerg Albert <jal2@gmx.de>
    
    diff -ru madwifi-ng-r1696-20060730/ath/if_ath.c madwifi-ng-r1696-20060730.work/ath/if_ath.c
    old new  
    53165316                         * ath_newstate as the state machine will go from 
    53175317                         * RUN -> RUN when this happens. 
    53185318                         */ 
    5319                         if (le64_to_cpu(ni->ni_tstamp.tsf) >= tsf) { 
     5319                        /* jal: added: don't merge if we have a desired 
     5320                           BSSID */ 
     5321                        if (!(vap->iv_flags & IEEE80211_F_DESBSSID) && 
     5322                                le64_to_cpu(ni->ni_tstamp.tsf) >= tsf) { 
    53205323                                DPRINTF(sc, ATH_DEBUG_STATE, 
    53215324                                        "ibss merge, rstamp %u tsf %llu " 
    53225325                                        "tstamp %llu\n", rstamp, (long long) tsf, 
  • net80211/ieee80211_wireless.c

    diff -ru madwifi-ng-r1696-20060730/net80211/ieee80211_wireless.c madwifi-ng-r1696-20060730.work/net80211/ieee80211_wireless.c
    old new  
    539539         * 
    540540         * anything else specifies a particular AP. 
    541541         */ 
    542         if (IEEE80211_ADDR_EQ(vap->iv_des_bssid, zero_bssid))  
     542        if (IEEE80211_ADDR_EQ(&ap_addr->sa_data, zero_bssid))  
    543543                vap->iv_flags &= ~IEEE80211_F_DESBSSID; 
    544544        else { 
    545545                IEEE80211_ADDR_COPY(vap->iv_des_bssid, &ap_addr->sa_data);