mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 23:52:08 +02:00
ipv6: fib_rules: Add port mask matching
Extend IPv6 FIB rules to match on source and destination ports using a mask. Note that the mask is only set when not matching on a range. Reviewed-by: Petr Machata <petrm@nvidia.com> Signed-off-by: Ido Schimmel <idosch@nvidia.com> Reviewed-by: Guillaume Nault <gnault@redhat.com> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://patch.msgid.link/20250217134109.311176-5-idosch@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
79a4e21584
commit
fc1266a061
|
|
@ -340,12 +340,12 @@ INDIRECT_CALLABLE_SCOPE int fib6_rule_match(struct fib_rule *rule,
|
|||
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))
|
||||
if (!fib_rule_port_match(&rule->sport_range, rule->sport_mask,
|
||||
fl6->fl6_sport))
|
||||
return 0;
|
||||
|
||||
if (fib_rule_port_range_set(&rule->dport_range) &&
|
||||
!fib_rule_port_inrange(&rule->dport_range, fl6->fl6_dport))
|
||||
if (!fib_rule_port_match(&rule->dport_range, rule->dport_mask,
|
||||
fl6->fl6_dport))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user