Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79453
b: refs/heads/master
c: da0e28c
h: refs/heads/master
i:
  79451: 319d95d
v: v3
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Jan 28, 2008
1 parent 162f12d commit 16b9813
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 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: ba93ef746560df597b19bbcee04ce7ed70ebc700
refs/heads/master: da0e28cb68a7e22b47c6ae1a5b12cb538c13c69f
9 changes: 5 additions & 4 deletions trunk/include/net/ip_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,16 @@ static inline struct fib_table *fib_new_table(struct net *net, u32 id)
return fib_get_table(net, id);
}

static inline int fib_lookup(const struct flowi *flp, struct fib_result *res)
static inline int fib_lookup(struct net *net, const struct flowi *flp,
struct fib_result *res)
{
struct fib_table *table;

table = fib_get_table(&init_net, RT_TABLE_LOCAL);
table = fib_get_table(net, RT_TABLE_LOCAL);
if (!table->tb_lookup(table, flp, res))
return 0;

table = fib_get_table(&init_net, RT_TABLE_MAIN);
table = fib_get_table(net, RT_TABLE_MAIN);
if (!table->tb_lookup(table, flp, res))
return 0;
return -ENETUNREACH;
Expand All @@ -208,7 +209,7 @@ extern void __net_exit fib4_rules_exit(struct net *net);
extern u32 fib_rules_tclass(struct fib_result *res);
#endif

extern int fib_lookup(struct flowi *flp, struct fib_result *res);
extern int fib_lookup(struct net *n, struct flowi *flp, struct fib_result *res);

extern struct fib_table *fib_new_table(struct net *net, u32 id);
extern struct fib_table *fib_get_table(struct net *net, u32 id);
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
if (in_dev == NULL)
goto e_inval;

if (fib_lookup(&fl, &res))
if (fib_lookup(&init_net, &fl, &res))
goto last_resort;
if (res.type != RTN_UNICAST)
goto e_inval_res;
Expand All @@ -265,7 +265,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
fl.oif = dev->ifindex;

ret = 0;
if (fib_lookup(&fl, &res) == 0) {
if (fib_lookup(&init_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;
Expand Down
4 changes: 2 additions & 2 deletions trunk/net/ipv4/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ u32 fib_rules_tclass(struct fib_result *res)
}
#endif

int fib_lookup(struct flowi *flp, struct fib_result *res)
int fib_lookup(struct net *net, struct flowi *flp, struct fib_result *res)
{
struct fib_lookup_arg arg = {
.result = res,
};
int err;

err = fib_rules_lookup(init_net.ipv4.rules_ops, flp, 0, &arg);
err = fib_rules_lookup(net->ipv4.rules_ops, flp, 0, &arg);
res->r = arg.rule;

return err;
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/fib_semantics.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
/* It is not necessary, but requires a bit of thinking */
if (fl.fl4_scope < RT_SCOPE_LINK)
fl.fl4_scope = RT_SCOPE_LINK;
if ((err = fib_lookup(&fl, &res)) != 0)
if ((err = fib_lookup(&init_net, &fl, &res)) != 0)
return err;
}
err = -EINVAL;
Expand Down
6 changes: 3 additions & 3 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1559,7 +1559,7 @@ void ip_rt_get_source(u8 *addr, struct rtable *rt)

if (rt->fl.iif == 0)
src = rt->rt_src;
else if (fib_lookup(&rt->fl, &res) == 0) {
else if (fib_lookup(&init_net, &rt->fl, &res) == 0) {
src = FIB_RES_PREFSRC(res);
fib_res_put(&res);
} else
Expand Down Expand Up @@ -1911,7 +1911,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(&fl, &res)) != 0) {
if ((err = fib_lookup(&init_net, &fl, &res)) != 0) {
if (!IN_DEV_FORWARD(in_dev))
goto e_hostunreach;
goto no_route;
Expand Down Expand Up @@ -2363,7 +2363,7 @@ static int ip_route_output_slow(struct rtable **rp, const struct flowi *oldflp)
goto make_route;
}

if (fib_lookup(&fl, &res)) {
if (fib_lookup(&init_net, &fl, &res)) {
res.fi = NULL;
if (oldflp->oif) {
/* Apparently, routing tables are wrong. Assume,
Expand Down

0 comments on commit 16b9813

Please sign in to comment.