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

    [NETNS]: Pass correct namespace in fib_validate_source.
    
    Correct network namespace is available inside fib_validate_source. It
    can be obtained from the device passed in. The device is not NULL as
    in_device is obtained from it just above.
    
    Signed-off-by: Denis V. Lunev <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/fib_frontend.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index e056154..6761639 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -228,6 +228,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int 
oif,
        struct fib_result res;
        int no_addr, rpf;
        int ret;
+       struct net *net;
 
        no_addr = rpf = 0;
        rcu_read_lock();
@@ -241,7 +242,8 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int 
oif,
        if (in_dev == NULL)
                goto e_inval;
 
-       if (fib_lookup(&init_net, &fl, &res))
+       net = dev->nd_net;
+       if (fib_lookup(net, &fl, &res))
                goto last_resort;
        if (res.type != RTN_UNICAST)
                goto e_inval_res;
@@ -265,7 +267,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int 
oif,
        fl.oif = dev->ifindex;
 
        ret = 0;
-       if (fib_lookup(&init_net, &fl, &res) == 0) {
+       if (fib_lookup(net, &fl, &res) == 0) {
                if (res.type == RTN_UNICAST) {
                        *spec_dst = FIB_RES_PREFSRC(res);
                        ret = FIB_RES_NH(res).nh_scope >= RT_SCOPE_HOST;
-
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