Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 315178
b: refs/heads/master
c: 85b91b0
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jul 13, 2012
1 parent 4c9d301 commit aae05db
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 31 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: d01cb20711e3c2df41677ee270d6bdeff24e9902
refs/heads/master: 85b91b0339e764f7e56ff5968fa10d85451378b4
12 changes: 3 additions & 9 deletions trunk/include/net/ip_fib.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,10 @@ struct fib_result {
unsigned char nh_sel;
unsigned char type;
unsigned char scope;
u32 tclassid;
struct fib_info *fi;
struct fib_table *table;
struct list_head *fa_head;
#ifdef CONFIG_IP_MULTIPLE_TABLES
struct fib_rule *r;
#endif
};

struct fib_result_nl {
Expand Down Expand Up @@ -215,10 +213,6 @@ static inline int fib_lookup(struct net *net, const struct flowi4 *flp,
extern int __net_init fib4_rules_init(struct net *net);
extern void __net_exit fib4_rules_exit(struct net *net);

#ifdef CONFIG_IP_ROUTE_CLASSID
extern u32 fib_rules_tclass(const struct fib_result *res);
#endif

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 All @@ -229,7 +223,7 @@ static inline int fib_lookup(struct net *net, struct flowi4 *flp,
struct fib_result *res)
{
if (!net->ipv4.fib_has_custom_rules) {
res->r = NULL;
res->tclassid = 0;
if (net->ipv4.fib_local &&
!fib_table_lookup(net->ipv4.fib_local, flp, res,
FIB_LOOKUP_NOREF))
Expand Down Expand Up @@ -289,7 +283,7 @@ static inline void fib_combine_itag(u32 *itag, const struct fib_result *res)
#endif
*itag = FIB_RES_NH(*res).nh_tclassid<<16;
#ifdef CONFIG_IP_MULTIPLE_TABLES
rtag = fib_rules_tclass(res);
rtag = res->tclassid;
if (*itag == 0)
*itag = (rtag<<16);
*itag |= (rtag>>16);
Expand Down
8 changes: 0 additions & 8 deletions trunk/net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ static inline unsigned int __inet_dev_addr_type(struct net *net,
if (ipv4_is_multicast(addr))
return RTN_MULTICAST;

#ifdef CONFIG_IP_MULTIPLE_TABLES
res.r = NULL;
#endif

local_table = fib_get_table(net, RT_TABLE_LOCAL);
if (local_table) {
ret = RTN_UNICAST;
Expand Down Expand Up @@ -934,10 +930,6 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb)
.flowi4_scope = frn->fl_scope,
};

#ifdef CONFIG_IP_MULTIPLE_TABLES
res.r = NULL;
#endif

frn->err = -ENOENT;
if (tb) {
local_bh_disable();
Expand Down
15 changes: 6 additions & 9 deletions trunk/net/ipv4/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ struct fib4_rule {
#endif
};

#ifdef CONFIG_IP_ROUTE_CLASSID
u32 fib_rules_tclass(const struct fib_result *res)
{
return res->r ? ((struct fib4_rule *) res->r)->tclassid : 0;
}
#endif

int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res)
{
struct fib_lookup_arg arg = {
Expand All @@ -63,8 +56,12 @@ int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res)
int err;

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

#ifdef CONFIG_IP_ROUTE_CLASSID
if (arg.rule)
res->tclassid = ((struct fib4_rule *)arg.rule)->tclassid;
else
res->tclassid = 0;
#endif
return err;
}
EXPORT_SYMBOL_GPL(__fib_lookup);
Expand Down
6 changes: 2 additions & 4 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,7 @@ static void rt_set_nexthop(struct rtable *rt, const struct flowi4 *fl4,

#ifdef CONFIG_IP_ROUTE_CLASSID
#ifdef CONFIG_IP_MULTIPLE_TABLES
set_class_tag(rt, fib_rules_tclass(res));
set_class_tag(rt, res->tclassid);
#endif
set_class_tag(rt, itag);
#endif
Expand Down Expand Up @@ -2353,11 +2353,9 @@ static struct rtable *ip_route_output_slow(struct net *net, struct flowi4 *fl4)
__be32 orig_saddr;
int orig_oif;

res.tclassid = 0;
res.fi = NULL;
res.table = NULL;
#ifdef CONFIG_IP_MULTIPLE_TABLES
res.r = NULL;
#endif

orig_daddr = fl4->daddr;
orig_saddr = fl4->saddr;
Expand Down

0 comments on commit aae05db

Please sign in to comment.