aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2007-03-26 20:14:15 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:28:12 -0400
commit0947c9fe56d9cf7ad0bc3a03ccd30446cde698e4 (patch)
tree10d40d8d536d686b8226907f942b064c4bc59a4b /include/net
parent2f7826c02447480c7c1b5500b34fc783f1ed8145 (diff)
[NET] fib_rules: goto rule action
This patch adds a new rule action FR_ACT_GOTO which allows to skip a set of rules by jumping to another rule. The rule to jump to is specified via the FRA_GOTO attribute which carries a rule preference. Referring to a rule which doesn't exists is explicitely allowed. Such goto rules are marked with the flag FIB_RULE_UNRESOLVED and will act like a rule with a non-matching selector. The rule will become functional as soon as its target is present. The goto action enables performance optimizations by reducing the average number of rules that have to be passed per lookup. Example: 0: from all lookup local 40: not from all to 192.168.23.128 goto 32766 41: from all fwmark 0xa blackhole 42: from all fwmark 0xff blackhole 32766: from all lookup main Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/fib_rules.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index ff3029fe9656..08bab8b6e575 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -19,6 +19,8 @@ struct fib_rule
19 u32 flags; 19 u32 flags;
20 u32 table; 20 u32 table;
21 u8 action; 21 u8 action;
22 u32 target;
23 struct fib_rule * ctarget;
22 struct rcu_head rcu; 24 struct rcu_head rcu;
23}; 25};
24 26
@@ -35,6 +37,8 @@ struct fib_rules_ops
35 struct list_head list; 37 struct list_head list;
36 int rule_size; 38 int rule_size;
37 int addr_size; 39 int addr_size;
40 int unresolved_rules;
41 int nr_goto_rules;
38 42
39 int (*action)(struct fib_rule *, 43 int (*action)(struct fib_rule *,
40 struct flowi *, int, 44 struct flowi *, int,
@@ -66,7 +70,8 @@ struct fib_rules_ops
66 [FRA_PRIORITY] = { .type = NLA_U32 }, \ 70 [FRA_PRIORITY] = { .type = NLA_U32 }, \
67 [FRA_FWMARK] = { .type = NLA_U32 }, \ 71 [FRA_FWMARK] = { .type = NLA_U32 }, \
68 [FRA_FWMASK] = { .type = NLA_U32 }, \ 72 [FRA_FWMASK] = { .type = NLA_U32 }, \
69 [FRA_TABLE] = { .type = NLA_U32 } 73 [FRA_TABLE] = { .type = NLA_U32 }, \
74 [FRA_GOTO] = { .type = NLA_U32 }
70 75
71static inline void fib_rule_get(struct fib_rule *rule) 76static inline void fib_rule_get(struct fib_rule *rule)
72{ 77{