Skip to content

Commit

Permalink
[NET] fib_rules: Add no-operation action
Browse files Browse the repository at this point in the history
The use of nop rules simplifies the usage of goto rules
and adds more flexibility as they allow targets to remain
while the actual content of the branches can change easly.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Graf authored and David S. Miller committed Apr 26, 2007
1 parent 2b44368 commit fa0b2d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/linux/fib_rules.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ enum
FR_ACT_UNSPEC,
FR_ACT_TO_TBL, /* Pass to fixed table */
FR_ACT_GOTO, /* Jump to another rule */
FR_ACT_RES2,
FR_ACT_NOP, /* No operation */
FR_ACT_RES3,
FR_ACT_RES4,
FR_ACT_BLACKHOLE, /* Drop without notification */
Expand Down
4 changes: 3 additions & 1 deletion net/core/fib_rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ int fib_rules_lookup(struct fib_rules_ops *ops, struct flowi *fl,
rule = target;
goto jumped;
}
} else
} else if (rule->action == FR_ACT_NOP)
continue;
else
err = ops->action(rule, fl, flags, arg);

if (err != -EAGAIN) {
Expand Down

0 comments on commit fa0b2d1

Please sign in to comment.