mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-09 02:51:11 +01:00
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 <[email protected]> Acked-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
4a2d73a4fb
commit
bb0ad1987e
1 file changed
+11
@@ -223,6 +223,17 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
|
||||
if (r->tclass && r->tclass != ip6_tclass(fl6->flowlabel))
|
||||
return 0;
|
||||
|
||||
if (rule->ip_proto && (rule->ip_proto != fl6->flowi6_proto))
|
||||
return 0;
|
||||
|
||||
if (fib_rule_port_range_set(&rule->sport_range) &&
|
||||
!fib_rule_port_inrange(&rule->sport_range, fl6->fl6_sport))
|
||||
return 0;
|
||||
|
||||
if (fib_rule_port_range_set(&rule->dport_range) &&
|
||||
!fib_rule_port_inrange(&rule->dport_range, fl6->fl6_dport))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user