diff options
author | Stefan Tomanek <stefan.tomanek@wertarbyte.de> | 2013-08-02 11:19:56 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-02 18:24:22 -0400 |
commit | 6ef94cfafba159d6b1a902ccb3349ac6a34ff6ad (patch) | |
tree | f2d7afebf4534ea50273165f4b0798aed704a37c /net/core | |
parent | d1c53c8e870cdedb6fc9550f41c558bab45b5219 (diff) |
fib_rules: add route suppression based on ifgroup
This change adds the ability to suppress a routing decision based upon the
interface group the selected interface belongs to. This allows it to
exclude specific devices from a routing decision.
Signed-off-by: Stefan Tomanek <stefan.tomanek@wertarbyte.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/fib_rules.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 2ef5040c99c8..5040a61bf28a 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
@@ -343,6 +343,9 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh) | |||
343 | if (tb[FRA_TABLE_PREFIXLEN_MIN]) | 343 | if (tb[FRA_TABLE_PREFIXLEN_MIN]) |
344 | rule->table_prefixlen_min = nla_get_u8(tb[FRA_TABLE_PREFIXLEN_MIN]); | 344 | rule->table_prefixlen_min = nla_get_u8(tb[FRA_TABLE_PREFIXLEN_MIN]); |
345 | 345 | ||
346 | if (tb[FRA_SUPPRESS_IFGROUP]) | ||
347 | rule->suppress_ifgroup = nla_get_u32(tb[FRA_SUPPRESS_IFGROUP]); | ||
348 | |||
346 | if (!tb[FRA_PRIORITY] && ops->default_pref) | 349 | if (!tb[FRA_PRIORITY] && ops->default_pref) |
347 | rule->pref = ops->default_pref(ops); | 350 | rule->pref = ops->default_pref(ops); |
348 | 351 | ||
@@ -529,6 +532,7 @@ static inline size_t fib_rule_nlmsg_size(struct fib_rules_ops *ops, | |||
529 | + nla_total_size(4) /* FRA_PRIORITY */ | 532 | + nla_total_size(4) /* FRA_PRIORITY */ |
530 | + nla_total_size(4) /* FRA_TABLE */ | 533 | + nla_total_size(4) /* FRA_TABLE */ |
531 | + nla_total_size(1) /* FRA_TABLE_PREFIXLEN_MIN */ | 534 | + nla_total_size(1) /* FRA_TABLE_PREFIXLEN_MIN */ |
535 | + nla_total_size(4) /* FRA_SUPPRESS_IFGROUP */ | ||
532 | + nla_total_size(4) /* FRA_FWMARK */ | 536 | + nla_total_size(4) /* FRA_FWMARK */ |
533 | + nla_total_size(4); /* FRA_FWMASK */ | 537 | + nla_total_size(4); /* FRA_FWMASK */ |
534 | 538 | ||
@@ -588,6 +592,12 @@ static int fib_nl_fill_rule(struct sk_buff *skb, struct fib_rule *rule, | |||
588 | (rule->target && | 592 | (rule->target && |
589 | nla_put_u32(skb, FRA_GOTO, rule->target))) | 593 | nla_put_u32(skb, FRA_GOTO, rule->target))) |
590 | goto nla_put_failure; | 594 | goto nla_put_failure; |
595 | |||
596 | if (rule->suppress_ifgroup != -1) { | ||
597 | if (nla_put_u32(skb, FRA_SUPPRESS_IFGROUP, rule->suppress_ifgroup)) | ||
598 | goto nla_put_failure; | ||
599 | } | ||
600 | |||
591 | if (ops->fill(rule, skb, frh) < 0) | 601 | if (ops->fill(rule, skb, frh) < 0) |
592 | goto nla_put_failure; | 602 | goto nla_put_failure; |
593 | 603 | ||