aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_rules.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-13 11:21:29 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-13 11:21:29 -0400
commit85b91b0339e764f7e56ff5968fa10d85451378b4 (patch)
tree539c368948900b35ee8d474829724a796b482d44 /net/ipv4/fib_rules.c
parentd01cb20711e3c2df41677ee270d6bdeff24e9902 (diff)
ipv4: Don't store a rule pointer in fib_result.
We only use it to fetch the rule's tclassid, so just store the tclassid there instead. This also decreases the size of fib_result by a full 8 bytes on 64-bit. On 32-bits it's a wash. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_rules.c')
-rw-r--r--net/ipv4/fib_rules.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/net/ipv4/fib_rules.c b/net/ipv4/fib_rules.c
index c06da93b0b70..a83d74e498d2 100644
--- a/net/ipv4/fib_rules.c
+++ b/net/ipv4/fib_rules.c
@@ -47,13 +47,6 @@ struct fib4_rule {
47#endif 47#endif
48}; 48};
49 49
50#ifdef CONFIG_IP_ROUTE_CLASSID
51u32 fib_rules_tclass(const struct fib_result *res)
52{
53 return res->r ? ((struct fib4_rule *) res->r)->tclassid : 0;
54}
55#endif
56
57int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res) 50int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res)
58{ 51{
59 struct fib_lookup_arg arg = { 52 struct fib_lookup_arg arg = {
@@ -63,8 +56,12 @@ int __fib_lookup(struct net *net, struct flowi4 *flp, struct fib_result *res)
63 int err; 56 int err;
64 57
65 err = fib_rules_lookup(net->ipv4.rules_ops, flowi4_to_flowi(flp), 0, &arg); 58 err = fib_rules_lookup(net->ipv4.rules_ops, flowi4_to_flowi(flp), 0, &arg);
66 res->r = arg.rule; 59#ifdef CONFIG_IP_ROUTE_CLASSID
67 60 if (arg.rule)
61 res->tclassid = ((struct fib4_rule *)arg.rule)->tclassid;
62 else
63 res->tclassid = 0;
64#endif
68 return err; 65 return err;
69} 66}
70EXPORT_SYMBOL_GPL(__fib_lookup); 67EXPORT_SYMBOL_GPL(__fib_lookup);