]> git.baikalelectronics.ru Git - kernel.git/commit
[NET] fib_rules: goto rule action
authorThomas Graf <tgraf@suug.ch>
Tue, 27 Mar 2007 00:14:15 +0000 (17:14 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:28:12 +0000 (22:28 -0700)
commite509938f92642752ed09151a0ad310363d165f55
tree10d40d8d536d686b8226907f942b064c4bc59a4b
parent6e801e948c38d9766c23ea0fd141d7b7672c229e
[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>
include/linux/fib_rules.h
include/net/fib_rules.h
net/core/fib_rules.c