net: Use nlmsg_unicast() instead of netlink_unicast()
[linux-2.6-microblaze.git] / net / ipv4 / fib_frontend.c
index 84bb707..9fe13e4 100644 (file)
@@ -371,6 +371,8 @@ static int __fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
                fl4.flowi4_proto = 0;
                fl4.fl4_sport = 0;
                fl4.fl4_dport = 0;
+       } else {
+               swap(fl4.fl4_sport, fl4.fl4_dport);
        }
 
        if (fib_lookup(net, &fl4, &res, 0))
@@ -1122,10 +1124,8 @@ void fib_add_ifaddr(struct in_ifaddr *ifa)
                                  prefix, ifa->ifa_prefixlen, prim,
                                  ifa->ifa_rt_priority);
 
-               /* Add network specific broadcasts, when it takes a sense */
+               /* Add the network broadcast address, when it makes sense */
                if (ifa->ifa_prefixlen < 31) {
-                       fib_magic(RTM_NEWROUTE, RTN_BROADCAST, prefix, 32,
-                                 prim, 0);
                        fib_magic(RTM_NEWROUTE, RTN_BROADCAST, prefix | ~mask,
                                  32, prim, 0);
                }
@@ -1376,7 +1376,7 @@ static void nl_fib_input(struct sk_buff *skb)
        portid = NETLINK_CB(skb).portid;      /* netlink portid */
        NETLINK_CB(skb).portid = 0;        /* from kernel */
        NETLINK_CB(skb).dst_group = 0;  /* unicast */
-       netlink_unicast(net->ipv4.fibnl, skb, portid, MSG_DONTWAIT);
+       nlmsg_unicast(net->ipv4.fibnl, skb, portid);
 }
 
 static int __net_init nl_fib_lookup_init(struct net *net)
@@ -1516,6 +1516,12 @@ static int __net_init ip_fib_net_init(struct net *net)
        if (err)
                return err;
 
+#ifdef CONFIG_IP_ROUTE_MULTIPATH
+       /* Default to 3-tuple */
+       net->ipv4.sysctl_fib_multipath_hash_fields =
+               FIB_MULTIPATH_HASH_FIELD_DEFAULT_MASK;
+#endif
+
        /* Avoid false sharing : Use at least a full cache line */
        size = max_t(size_t, size, L1_CACHE_BYTES);