diff options
author | Denis V. Lunev <den@openvz.org> | 2008-01-21 20:34:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:10:22 -0500 |
commit | 84a885f44961c17a91cae9a9c03e4b3dae5d8d94 (patch) | |
tree | 008cdba1ea0e14fdb2b95a74ad8e7998e37c49ae /net | |
parent | 86167a377f1c4fb40742302ae7682dd574abde86 (diff) |
[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 <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | 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 a7651c64bb48..f988ae39c4c2 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, | |||
1881 | __be32 spec_dst; | 1881 | __be32 spec_dst; |
1882 | int err = -EINVAL; | 1882 | int err = -EINVAL; |
1883 | int free_res = 0; | 1883 | int free_res = 0; |
1884 | struct net * net = dev->nd_net; | ||
1884 | 1885 | ||
1885 | /* IP on this device is disabled. */ | 1886 | /* IP on this device is disabled. */ |
1886 | 1887 | ||
@@ -1911,7 +1912,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
1911 | /* | 1912 | /* |
1912 | * Now we are ready to route packet. | 1913 | * Now we are ready to route packet. |
1913 | */ | 1914 | */ |
1914 | if ((err = fib_lookup(&init_net, &fl, &res)) != 0) { | 1915 | if ((err = fib_lookup(net, &fl, &res)) != 0) { |
1915 | if (!IN_DEV_FORWARD(in_dev)) | 1916 | if (!IN_DEV_FORWARD(in_dev)) |
1916 | goto e_hostunreach; | 1917 | goto e_hostunreach; |
1917 | goto no_route; | 1918 | goto no_route; |
@@ -1926,7 +1927,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
1926 | if (res.type == RTN_LOCAL) { | 1927 | if (res.type == RTN_LOCAL) { |
1927 | int result; | 1928 | int result; |
1928 | result = fib_validate_source(saddr, daddr, tos, | 1929 | result = fib_validate_source(saddr, daddr, tos, |
1929 | init_net.loopback_dev->ifindex, | 1930 | net->loopback_dev->ifindex, |
1930 | dev, &spec_dst, &itag); | 1931 | dev, &spec_dst, &itag); |
1931 | if (result < 0) | 1932 | if (result < 0) |
1932 | goto martian_source; | 1933 | goto martian_source; |
@@ -1988,7 +1989,7 @@ local_input: | |||
1988 | #endif | 1989 | #endif |
1989 | rth->rt_iif = | 1990 | rth->rt_iif = |
1990 | rth->fl.iif = dev->ifindex; | 1991 | rth->fl.iif = dev->ifindex; |
1991 | rth->u.dst.dev = init_net.loopback_dev; | 1992 | rth->u.dst.dev = net->loopback_dev; |
1992 | dev_hold(rth->u.dst.dev); | 1993 | dev_hold(rth->u.dst.dev); |
1993 | rth->idev = in_dev_get(rth->u.dst.dev); | 1994 | rth->idev = in_dev_get(rth->u.dst.dev); |
1994 | rth->rt_gateway = daddr; | 1995 | rth->rt_gateway = daddr; |