Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=86167a377f1c4fb40742302ae7682dd574abde86
Commit:     86167a377f1c4fb40742302ae7682dd574abde86
Parent:     5b707aaae4ca7b7204eb4a472721c84866d85f0f
Author:     Denis V. Lunev <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 21 17:34:00 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:10:21 2008 -0800

    [NETNS]: Pass correct namespace in context fib_check_nh.
    
    Correct network namespace is already used in fib_check_nh. Re-work its
    usage for better readability and pass into fib_lookup &
    inetdev_by_index.
    
    Signed-off-by: Denis V. Lunev <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/fib_semantics.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 8b47e11..c791286 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -519,7 +519,9 @@ static int fib_check_nh(struct fib_config *cfg, struct 
fib_info *fi,
                        struct fib_nh *nh)
 {
        int err;
+       struct net *net;
 
+       net = cfg->fc_nlinfo.nl_net;
        if (nh->nh_gw) {
                struct fib_result res;
 
@@ -532,11 +534,9 @@ 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(cfg->fc_nlinfo.nl_net,
-                                          nh->nh_gw) != RTN_UNICAST)
+                       if (inet_addr_type(net, nh->nh_gw) != RTN_UNICAST)
                                return -EINVAL;
-                       if ((dev = __dev_get_by_index(cfg->fc_nlinfo.nl_net,
-                                                     nh->nh_oif)) == NULL)
+                       if ((dev = __dev_get_by_index(net, nh->nh_oif)) == NULL)
                                return -ENODEV;
                        if (!(dev->flags&IFF_UP))
                                return -ENETDOWN;
@@ -559,7 +559,7 @@ static int fib_check_nh(struct fib_config *cfg, struct 
fib_info *fi,
                        /* It is not necessary, but requires a bit of thinking 
*/
                        if (fl.fl4_scope < RT_SCOPE_LINK)
                                fl.fl4_scope = RT_SCOPE_LINK;
-                       if ((err = fib_lookup(&init_net, &fl, &res)) != 0)
+                       if ((err = fib_lookup(net, &fl, &res)) != 0)
                                return err;
                }
                err = -EINVAL;
@@ -583,7 +583,7 @@ out:
                if (nh->nh_flags&(RTNH_F_PERVASIVE|RTNH_F_ONLINK))
                        return -EINVAL;
 
-               in_dev = inetdev_by_index(&init_net, nh->nh_oif);
+               in_dev = inetdev_by_index(net, nh->nh_oif);
                if (in_dev == NULL)
                        return -ENODEV;
                if (!(in_dev->dev->flags&IFF_UP)) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to