aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/fib_rules.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-29 04:32:45 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-29 04:36:36 -0400
commit7a9bc9b81a5bc6e44ebc80ef781332e4385083f2 (patch)
tree1342c672823d47bfb112fee63951af9f6a3eb590 /include/net/fib_rules.h
parentb8c8430726e5bd552e01dacc5a44f3f83f7446ca (diff)
ipv4: Elide fib_validate_source() completely when possible.
If rpfilter is off (or the SKB has an IPSEC path) and there are not tclassid users, we don't have to do anything at all when fib_validate_source() is invoked besides setting the itag to zero. We monitor tclassid uses with a counter (modified only under RTNL and marked __read_mostly) and we protect the fib_validate_source() real work with a test against this counter and whether rpfilter is to be done. Having a way to know whether we need no tclassid processing or not also opens the door for future optimized rpfilter algorithms that do not perform full FIB lookups. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/fib_rules.h')
-rw-r--r--include/net/fib_rules.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index 075f1e3a0fe..e361f488242 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -52,6 +52,7 @@ struct fib_rules_ops {
52 struct sk_buff *, 52 struct sk_buff *,
53 struct fib_rule_hdr *, 53 struct fib_rule_hdr *,
54 struct nlattr **); 54 struct nlattr **);
55 void (*delete)(struct fib_rule *);
55 int (*compare)(struct fib_rule *, 56 int (*compare)(struct fib_rule *,
56 struct fib_rule_hdr *, 57 struct fib_rule_hdr *,
57 struct nlattr **); 58 struct nlattr **);