aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorStefan Tomanek <stefan.tomanek@wertarbyte.de>2013-08-02 11:19:56 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-02 18:24:22 -0400
commit6ef94cfafba159d6b1a902ccb3349ac6a34ff6ad (patch)
treef2d7afebf4534ea50273165f4b0798aed704a37c /net/ipv6
parentd1c53c8e870cdedb6fc9550f41c558bab45b5219 (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/ipv6')
-rw-r--r--net/ipv6/fib6_rules.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 554a4fbabfb3..36283267e2f8 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -122,14 +122,24 @@ out:
122static bool fib6_rule_suppress(struct fib_rule *rule, struct fib_lookup_arg *arg) 122static bool fib6_rule_suppress(struct fib_rule *rule, struct fib_lookup_arg *arg)
123{ 123{
124 struct rt6_info *rt = (struct rt6_info *) arg->result; 124 struct rt6_info *rt = (struct rt6_info *) arg->result;
125 struct net_device *dev = rt->rt6i_idev->dev;
125 /* do not accept result if the route does 126 /* do not accept result if the route does
126 * not meet the required prefix length 127 * not meet the required prefix length
127 */ 128 */
128 if (rt->rt6i_dst.plen < rule->table_prefixlen_min) { 129 if (rt->rt6i_dst.plen < rule->table_prefixlen_min)
130 goto suppress_route;
131
132 /* do not accept result if the route uses a device
133 * belonging to a forbidden interface group
134 */
135 if (rule->suppress_ifgroup != -1 && dev && dev->group == rule->suppress_ifgroup)
136 goto suppress_route;
137
138 return false;
139
140suppress_route:
129 ip6_rt_put(rt); 141 ip6_rt_put(rt);
130 return true; 142 return true;
131 }
132 return false;
133} 143}
134 144
135static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) 145static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)