Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79517
b: refs/heads/master
c: b40afd0
h: refs/heads/master
i:
  79515: e44ba50
v: v3
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Jan 28, 2008
1 parent b3df9fa commit 4d6c496
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ab352768fc73838b062776ca5d1add3876a019f
refs/heads/master: b40afd0e5c568aba79a4ae2a963cd2af1f09490d
21 changes: 11 additions & 10 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2248,7 +2248,8 @@ static inline int ip_mkroute_output(struct rtable **rp,
* Major route resolver routine.
*/

static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
static int ip_route_output_slow(struct net *net, struct rtable **rp,
const struct flowi *oldflp)
{
u32 tos = RT_FL_TOS(oldflp);
struct flowi fl = { .nl_u = { .ip4_u =
Expand All @@ -2260,7 +2261,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
RT_SCOPE_UNIVERSE),
} },
.mark = oldflp->mark,
.iif = init_net.loopback_dev->ifindex,
.iif = net->loopback_dev->ifindex,
.oif = oldflp->oif };
struct fib_result res;
unsigned flags = 0;
Expand All @@ -2282,7 +2283,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
goto out;

/* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
dev_out = ip_dev_find(&init_net, oldflp->fl4_src);
dev_out = ip_dev_find(net, oldflp->fl4_src);
if (dev_out == NULL)
goto out;

Expand Down Expand Up @@ -2322,7 +2323,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)


if (oldflp->oif) {
dev_out = dev_get_by_index(&init_net, oldflp->oif);
dev_out = dev_get_by_index(net, oldflp->oif);
err = -ENODEV;
if (dev_out == NULL)
goto out;
Expand Down Expand Up @@ -2356,15 +2357,15 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
fl.fl4_dst = fl.fl4_src = htonl(INADDR_LOOPBACK);
if (dev_out)
dev_put(dev_out);
dev_out = init_net.loopback_dev;
dev_out = net->loopback_dev;
dev_hold(dev_out);
fl.oif = init_net.loopback_dev->ifindex;
fl.oif = net->loopback_dev->ifindex;
res.type = RTN_LOCAL;
flags |= RTCF_LOCAL;
goto make_route;
}

if (fib_lookup(&init_net, &fl, &res)) {
if (fib_lookup(net, &fl, &res)) {
res.fi = NULL;
if (oldflp->oif) {
/* Apparently, routing tables are wrong. Assume,
Expand Down Expand Up @@ -2403,7 +2404,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
fl.fl4_src = fl.fl4_dst;
if (dev_out)
dev_put(dev_out);
dev_out = init_net.loopback_dev;
dev_out = net->loopback_dev;
dev_hold(dev_out);
fl.oif = dev_out->ifindex;
if (res.fi)
Expand All @@ -2419,7 +2420,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
else
#endif
if (!res.prefixlen && res.type == RTN_UNICAST && !fl.oif)
fib_select_default(&init_net, &fl, &res);
fib_select_default(net, &fl, &res);

if (!fl.fl4_src)
fl.fl4_src = FIB_RES_PREFSRC(res);
Expand Down Expand Up @@ -2469,7 +2470,7 @@ int __ip_route_output_key(struct rtable **rp, const struct flowi *flp)
}
rcu_read_unlock_bh();

return ip_route_output_slow(rp, flp);
return ip_route_output_slow(&init_net, rp, flp);
}

EXPORT_SYMBOL_GPL(__ip_route_output_key);
Expand Down

0 comments on commit 4d6c496

Please sign in to comment.