diff options
author | Roopa Prabhu <roopa@cumulusnetworks.com> | 2018-02-28 22:41:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-28 22:44:43 -0500 |
commit | bb0ad1987e963e47a02cc53b8275ffe2b38d4b70 (patch) | |
tree | ebcf6f357c03c59969fda012bebd14fc989affc9 /net/ipv6/fib6_rules.c | |
parent | 4a2d73a4fb36ed4d73967bd3892cfab014a52ab2 (diff) |
ipv6: fib6_rules: support for match on sport, dport and ip proto
support to match on src port, dst port and ip protocol.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/fib6_rules.c')
-rw-r--r-- | net/ipv6/fib6_rules.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c index 95a2c9e8699a..bcd1f22ac7b1 100644 --- a/net/ipv6/fib6_rules.c +++ b/net/ipv6/fib6_rules.c | |||
@@ -223,6 +223,17 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) | |||
223 | if (r->tclass && r->tclass != ip6_tclass(fl6->flowlabel)) | 223 | if (r->tclass && r->tclass != ip6_tclass(fl6->flowlabel)) |
224 | return 0; | 224 | return 0; |
225 | 225 | ||
226 | if (rule->ip_proto && (rule->ip_proto != fl6->flowi6_proto)) | ||
227 | return 0; | ||
228 | |||
229 | if (fib_rule_port_range_set(&rule->sport_range) && | ||
230 | !fib_rule_port_inrange(&rule->sport_range, fl6->fl6_sport)) | ||
231 | return 0; | ||
232 | |||
233 | if (fib_rule_port_range_set(&rule->dport_range) && | ||
234 | !fib_rule_port_inrange(&rule->dport_range, fl6->fl6_dport)) | ||
235 | return 0; | ||
236 | |||
226 | return 1; | 237 | return 1; |
227 | } | 238 | } |
228 | 239 | ||