]> 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 1351a2617dcef072ee0adebdd59ea1007b9a4bbd..0de6102020e23668a4c7c3fa35cd6df581f99361 100644 (file)
@@ -320,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
@@ -346,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;
@@ -358,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;
        }
@@ -531,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(&init_net, 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;
@@ -605,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)
@@ -712,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;
@@ -799,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(&init_net, 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;
@@ -813,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;
        }