On 9/15/15 2:29 PM, Peter Nørlund wrote:
@@ -1094,8 +1142,15 @@ struct fib_info *fib_create_info(struct fib_config *cfg)

        change_nexthops(fi) {
                fib_info_update_nh_saddr(net, nexthop_nh);
+#ifdef CONFIG_IP_ROUTE_MULTIPATH
+               fi->fib_weight += nexthop_nh->nh_weight;
+#endif
        } endfor_nexthops(fi)

+#ifdef CONFIG_IP_ROUTE_MULTIPATH
+       fib_rebalance(fi);
+#endif

The ifdefs everywhere make this harder to read. Just have a second definition above for fib_rebalance(fi) when CONFIG_IP_ROUTE_MULTIPATH is not defined.

Similarly an inlined macro of fi->fib_weight that compiles out if CONFIG_IP_ROUTE_MULTIPATH is not defined.

David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to