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

    [NETNS]: Pass correct namespace in ip_route_input_slow.
    
    The packet on the input path always has a referrence to an input
    network device it is passed from. Extract network namespace from it.
    
    Signed-off-by: Denis V. Lunev <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/route.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index a7651c6..f988ae3 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1881,6 +1881,7 @@ static int ip_route_input_slow(struct sk_buff *skb, 
__be32 daddr, __be32 saddr,
        __be32          spec_dst;
        int             err = -EINVAL;
        int             free_res = 0;
+       struct net    * net = dev->nd_net;
 
        /* IP on this device is disabled. */
 
@@ -1911,7 +1912,7 @@ static int ip_route_input_slow(struct sk_buff *skb, 
__be32 daddr, __be32 saddr,
        /*
         *      Now we are ready to route packet.
         */
-       if ((err = fib_lookup(&init_net, &fl, &res)) != 0) {
+       if ((err = fib_lookup(net, &fl, &res)) != 0) {
                if (!IN_DEV_FORWARD(in_dev))
                        goto e_hostunreach;
                goto no_route;
@@ -1926,7 +1927,7 @@ static int ip_route_input_slow(struct sk_buff *skb, 
__be32 daddr, __be32 saddr,
        if (res.type == RTN_LOCAL) {
                int result;
                result = fib_validate_source(saddr, daddr, tos,
-                                            init_net.loopback_dev->ifindex,
+                                            net->loopback_dev->ifindex,
                                             dev, &spec_dst, &itag);
                if (result < 0)
                        goto martian_source;
@@ -1988,7 +1989,7 @@ local_input:
 #endif
        rth->rt_iif     =
        rth->fl.iif     = dev->ifindex;
-       rth->u.dst.dev  = init_net.loopback_dev;
+       rth->u.dst.dev  = net->loopback_dev;
        dev_hold(rth->u.dst.dev);
        rth->idev       = in_dev_get(rth->u.dst.dev);
        rth->rt_gateway = daddr;
-
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