[PATCH] multipath routing algorithm, better patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

The last patch wont work, this should.

This patch assigns the multipath routing algorithm into the fib_info
struct's fib_mp_alg variable. Previously, the algorithm was always set to
IP_MP_ALG_NONE which was incorrect. This patch corrects the problem by
assigning the correct value when a fib_info is initialized.

This patch was tested against kernel 2.6.12.1 for all multipath routing
algorithms (none, round robin, interface round robin, random, weighted
random).

Please look this patch over and apply it to the kernel. I have been unable
to contact the creators of the multipath algorithm feature so this is why
I sent it to the lkml.

I am not a member of the list so please cc me in the reply.

Signed-off-by: Patrick Jenkins <[email protected]>

--- linux-2.6.12/net/ipv4/fib_semantics.c.orig 2005-06-30 20:07:13.000000000 -0400 +++ linux-2.6.12/net/ipv4/fib_semantics.c 2005-06-30 20:06:36.000000000 -0400
@@ -650,9 +650,22 @@ fib_create_info(const struct rtmsg *r, s
 #else
        const int nhs = 1;
 #endif
+
 #ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
+
+#ifdef CONFIG_IP_ROUTE_MULTIPATH_RR
+       u32 mp_alg = IP_MP_ALG_RR;
+#elif CONFIG_IP_ROUTE_MULTIPATH_DRR
+       u32 mp_alg = IP_MP_ALG_DRR;
+#elif CONFIG_IP_ROUTE_MULTIPATH_RANDOM
+       u32 mp_alg = IP_MP_ALG_RANDOM;
+#elif CONFIG_IP_ROUTE_MULTIPATH_WRANDOM
+       u32 mp_alg = IP_MP_ALG_WRANDOM;
+#else
        u32 mp_alg = IP_MP_ALG_NONE;
-#endif
+#endif /* multipath algorithm determination */
+
+#endif /* CONFIG_IP_ROUTE_MULTIPATH_CACHED */

        /* Fast check to catch the most weird cases */
        if (fib_props[r->rtm_type].scope > r->rtm_scope)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux