since ieee80211_input() can be called by ieee80211_input_all(), we need to check...
authormtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 21 Nov 2007 09:39:42 +0000 (09:39 +0000)
committermtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 21 Nov 2007 09:39:42 +0000 (09:39 +0000)
updating statistics of all known nodes for every inbound packet for an unknown node.

Merging this fix back from DFS branch, found by Benoit.
-gThis line, and those below, will be ignored--

M    ieee80211_input.c

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2882 0192ed92-7a03-0410-a25b-9323aeb14dbd

net80211/ieee80211_input.c

index 273e50899a7f8e623225dd3043034d9fdbca499a..8f133898b68be926a8d1ad589102b9b02d66f40e 100644 (file)
@@ -386,9 +386,15 @@ ieee80211_input(struct ieee80211_node *ni,
                        /* XXX catch bad values */
                        goto out;
                }
-               ni->ni_rssi = rssi;
-               ni->ni_rtsf = rtsf;
-               ni->ni_last_rx = jiffies;
+               /* since ieee80211_input() can be called by
+                * ieee80211_input_all(), we need to check that we are not
+                * updating for unknown nodes. FIXME : such check might be
+                * needed at other places */
+               if (IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) {
+                       ni->ni_rssi = rssi;
+                       ni->ni_rtsf = rtsf;
+                       ni->ni_last_rx = jiffies;
+               }
                if (HAS_SEQ(type)) {
                        u_int8_t tid;
                        if (IEEE80211_QOS_HAS_SEQ(wh)) {
@@ -551,7 +557,7 @@ ieee80211_input(struct ieee80211_node *ni,
                                if (ni_wds == NULL)
                                        ieee80211_add_wds_addr(nt, ni, wh4->i_addr4, 0);
                                else
-                                       ieee80211_unref_node(&ni_wds); /* Decr. ref count */
+                                       ieee80211_unref_node(&ni_wds);
                        }
 
                        /*