Date: Mon, 23 May 2005 21:23:21 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 77361 for review Message-ID: <200505232123.j4NLNLmN093785@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=77361 Change 77361 by sam@sam_ebb on 2005/05/23 21:22:28 track beacon tsf Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_input.c#16 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_input.c#16 (text+ko) ==== @@ -2275,6 +2275,9 @@ if (vap->iv_opmode == IEEE80211_M_STA && ni->ni_associd != 0 && IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_bssid)) { + /* record tsf of last beacon */ + memcpy(ni->ni_tstamp.data, scan.tstamp, + sizeof(ni->ni_tstamp)); if (ni->ni_erp != scan.erp) { IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni, "erp change: was 0x%x, now 0x%x", @@ -2372,17 +2375,19 @@ subtype, rssi, rstamp); return; } - /* - * Adhoc mode, do neighbor discovery. - * NB: only record ibss stations - */ - if ((scan.capinfo & IEEE80211_CAPINFO_IBSS) && - (ni == vap->iv_bss && - !IEEE80211_ADDR_EQ(ni->ni_macaddr, wh->i_addr2))) { - /* - * Create a new entry in the neighbor table. - */ - ni = ieee80211_add_neighbor(vap, wh, &scan); + if (scan.capinfo & IEEE80211_CAPINFO_IBSS) { + if (!IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { + /* + * Create a new entry in the neighbor table. + */ + ni = ieee80211_add_neighbor(vap, wh, &scan); + } else { + /* + * Record tsf for potential resync. + */ + memcpy(ni->ni_tstamp.data, scan.tstamp, + sizeof(ni->ni_tstamp)); + } if (ni != NULL) { ni->ni_rssi = rssi; ni->ni_rstamp = rstamp;help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505232123.j4NLNLmN093785>
