Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[pandora-kernel.git] / net / ipv4 / multipath_rr.c
index 554a825..896246d 100644 (file)
@@ -12,7 +12,6 @@
  *             2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
 #include <linux/types.h>
@@ -31,6 +30,7 @@
 #include <linux/igmp.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
+#include <linux/module.h>
 #include <linux/mroute.h>
 #include <linux/init.h>
 #include <net/ip.h>
 #include <net/checksum.h>
 #include <net/ip_mp_alg.h>
 
-#define MULTIPATH_MAX_CANDIDATES 40
-
-static struct rtable* last_used = NULL;
-
-static void rr_remove(struct rtable *rt)
-{
-       if (last_used == rt)
-               last_used = NULL;
-}
-
 static void rr_select_route(const struct flowi *flp,
                            struct rtable *first, struct rtable **rp)
 {
        struct rtable *nh, *result, *min_use_cand = NULL;
        int min_use = -1;
 
-       /* if necessary and possible utilize the old alternative */
-       if ((flp->flags & FLOWI_FLAG_MULTIPATHOLDROUTE) != 0 &&
-           last_used != NULL) {
-               result = last_used;
-               goto out;
-       }
-
        /* 1. make sure all alt. nexthops have the same GC related data
         * 2. determine the new candidate to be returned
         */
        result = NULL;
        for (nh = rcu_dereference(first); nh;
-            nh = rcu_dereference(nh->u.rt_next)) {
+            nh = rcu_dereference(nh->u.dst.rt_next)) {
                if ((nh->u.dst.flags & DST_BALANCED) != 0 &&
                    multipath_comparekeys(&nh->fl, flp)) {
                        nh->u.dst.lastuse = jiffies;
@@ -90,15 +73,12 @@ static void rr_select_route(const struct flowi *flp,
        if (!result)
                result = first;
 
-out:
-       last_used = result;
        result->u.dst.__use++;
        *rp = result;
 }
 
 static struct ip_mp_alg_ops rr_ops = {
        .mp_alg_select_route    =       rr_select_route,
-       .mp_alg_remove          =       rr_remove,
 };
 
 static int __init rr_init(void)
@@ -113,3 +93,4 @@ static void __exit rr_exit(void)
 
 module_init(rr_init);
 module_exit(rr_exit);
+MODULE_LICENSE("GPL");