diff options
Diffstat (limited to 'net/ipv4/route.c')
-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; |