mac80211: Revert 'Use correct sign for mesh active path refresh'
authorJavier Cardona <javier@cozybit.com>
Thu, 10 Dec 2009 02:43:01 +0000 (18:43 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 10 Dec 2009 21:12:52 +0000 (16:12 -0500)
The patch ("mac80211: Use correct sign for mesh active path
refresh.") was actually a bug.  Reverted it and improved the
explanation of how mesh path refresh works.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mesh.h
net/mac80211/mesh_hwmp.c

index 31e102541869080729120683f69eef29d381f59e..85562c59d7d68bd656fdd1ca00f6129b8adefe8c 100644 (file)
@@ -188,8 +188,9 @@ struct mesh_rmc {
  */
 #define MESH_PREQ_MIN_INT      10
 #define MESH_DIAM_TRAVERSAL_TIME 50
-/* Paths will be refreshed if they are closer than PATH_REFRESH_TIME to their
- * expiration
+/* A path will be refreshed if it is used PATH_REFRESH_TIME milliseconds before
+ * timing out.  This way it will remain ACTIVE and no data frames will be
+ * unnecesarily held in the pending queue.
  */
 #define MESH_PATH_REFRESH_TIME                 1000
 #define MESH_MIN_DISCOVERY_TIMEOUT (2 * MESH_DIAM_TRAVERSAL_TIME)
index 833b2f3670c59ff83c7d3517630706217472f4ee..d28acb6b1f8151e2a822ec5fc697231b5d76e698 100644 (file)
@@ -937,7 +937,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb,
 
        if (mpath->flags & MESH_PATH_ACTIVE) {
                if (time_after(jiffies,
-                              mpath->exp_time +
+                              mpath->exp_time -
                               msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) &&
                    !memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) &&
                    !(mpath->flags & MESH_PATH_RESOLVING) &&