]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/fib_semantics.c
[TCP]: Uninline tcp_set_state
[linux-2.6-omap-h63xx.git] / net / ipv4 / fib_semantics.c
index bb94550d95c3e8a2c80b1fc74bed9b9eb1b52a5a..0de6102020e23668a4c7c3fa35cd6df581f99361 100644 (file)
@@ -42,7 +42,6 @@
 #include <net/tcp.h>
 #include <net/sock.h>
 #include <net/ip_fib.h>
-#include <net/ip_mp_alg.h>
 #include <net/netlink.h>
 #include <net/nexthop.h>
 
@@ -321,11 +320,11 @@ void rtmsg_fib(int event, __be32 key, struct fib_alias *fa,
                kfree_skb(skb);
                goto errout;
        }
-       err = rtnl_notify(skb, info->pid, RTNLGRP_IPV4_ROUTE,
+       err = rtnl_notify(skb, info->nl_net, info->pid, RTNLGRP_IPV4_ROUTE,
                          info->nlh, GFP_KERNEL);
 errout:
        if (err < 0)
-               rtnl_set_sk_err(RTNLGRP_IPV4_ROUTE, err);
+               rtnl_set_sk_err(info->nl_net, RTNLGRP_IPV4_ROUTE, err);
 }
 
 /* Return the first fib alias matching TOS with
@@ -347,7 +346,7 @@ struct fib_alias *fib_find_alias(struct list_head *fah, u8 tos, u32 prio)
 }
 
 int fib_detect_death(struct fib_info *fi, int order,
-                    struct fib_info **last_resort, int *last_idx, int *dflt)
+                    struct fib_info **last_resort, int *last_idx, int dflt)
 {
        struct neighbour *n;
        int state = NUD_NONE;
@@ -359,10 +358,10 @@ int fib_detect_death(struct fib_info *fi, int order,
        }
        if (state==NUD_REACHABLE)
                return 0;
-       if ((state&NUD_VALID) && order != *dflt)
+       if ((state&NUD_VALID) && order != dflt)
                return 0;
        if ((state&NUD_VALID) ||
-           (*last_idx<0 && order > *dflt)) {
+           (*last_idx<0 && order > dflt)) {
                *last_resort = fi;
                *last_idx = order;
        }
@@ -532,9 +531,11 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
 
                        if (cfg->fc_scope >= RT_SCOPE_LINK)
                                return -EINVAL;
-                       if (inet_addr_type(nh->nh_gw) != RTN_UNICAST)
+                       if (inet_addr_type(cfg->fc_nlinfo.nl_net,
+                                          nh->nh_gw) != RTN_UNICAST)
                                return -EINVAL;
-                       if ((dev = __dev_get_by_index(nh->nh_oif)) == NULL)
+                       if ((dev = __dev_get_by_index(cfg->fc_nlinfo.nl_net,
+                                                     nh->nh_oif)) == NULL)
                                return -ENODEV;
                        if (!(dev->flags&IFF_UP))
                                return -ENETDOWN;
@@ -606,10 +607,10 @@ static inline unsigned int fib_laddr_hashfn(__be32 val)
 static struct hlist_head *fib_hash_alloc(int bytes)
 {
        if (bytes <= PAGE_SIZE)
-               return kmalloc(bytes, GFP_KERNEL);
+               return kzalloc(bytes, GFP_KERNEL);
        else
                return (struct hlist_head *)
-                       __get_free_pages(GFP_KERNEL, get_order(bytes));
+                       __get_free_pages(GFP_KERNEL | __GFP_ZERO, get_order(bytes));
 }
 
 static void fib_hash_free(struct hlist_head *hash, int bytes)
@@ -697,13 +698,6 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
                        goto err_inval;
        }
 #endif
-#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
-       if (cfg->fc_mp_alg) {
-               if (cfg->fc_mp_alg < IP_MP_ALG_NONE ||
-                   cfg->fc_mp_alg > IP_MP_ALG_MAX)
-                       goto err_inval;
-       }
-#endif
 
        err = -ENOBUFS;
        if (fib_info_cnt >= fib_hash_size) {
@@ -720,12 +714,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
                if (!new_info_hash || !new_laddrhash) {
                        fib_hash_free(new_info_hash, bytes);
                        fib_hash_free(new_laddrhash, bytes);
-               } else {
-                       memset(new_info_hash, 0, bytes);
-                       memset(new_laddrhash, 0, bytes);
-
+               } else
                        fib_hash_move(new_info_hash, new_laddrhash, new_size);
-               }
 
                if (!fib_hash_size)
                        goto failure;
@@ -751,7 +741,7 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
                int remaining;
 
                nla_for_each_attr(nla, cfg->fc_mx, cfg->fc_mx_len, remaining) {
-                       int type = nla->nla_type;
+                       int type = nla_type(nla);
 
                        if (type) {
                                if (type > RTAX_MAX)
@@ -791,10 +781,6 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
 #endif
        }
 
-#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
-       fi->fib_mp_alg = cfg->fc_mp_alg;
-#endif
-
        if (fib_props[cfg->fc_type].error) {
                if (cfg->fc_gw || cfg->fc_oif || cfg->fc_mp)
                        goto err_inval;
@@ -811,7 +797,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
                if (nhs != 1 || nh->nh_gw)
                        goto err_inval;
                nh->nh_scope = RT_SCOPE_NOWHERE;
-               nh->nh_dev = dev_get_by_index(fi->fib_nh->nh_oif);
+               nh->nh_dev = dev_get_by_index(cfg->fc_nlinfo.nl_net,
+                                             fi->fib_nh->nh_oif);
                err = -ENODEV;
                if (nh->nh_dev == NULL)
                        goto failure;
@@ -825,7 +812,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
        if (fi->fib_prefsrc) {
                if (cfg->fc_type != RTN_LOCAL || !cfg->fc_dst ||
                    fi->fib_prefsrc != cfg->fc_dst)
-                       if (inet_addr_type(fi->fib_prefsrc) != RTN_LOCAL)
+                       if (inet_addr_type(cfg->fc_nlinfo.nl_net,
+                                          fi->fib_prefsrc) != RTN_LOCAL)
                                goto err_inval;
        }
 
@@ -940,10 +928,6 @@ out_fill_res:
        res->type = fa->fa_type;
        res->scope = fa->fa_scope;
        res->fi = fa->fa_info;
-#ifdef CONFIG_IP_ROUTE_MULTIPATH_CACHED
-       res->netmask = mask;
-       res->network = zone & inet_make_mask(prefixlen);
-#endif
        atomic_inc(&res->fi->fib_clntref);
        return 0;
 }