Skip to content

Commit bb0ad19

Browse files
roopa-prabhudavem330
authored andcommitted
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]>
1 parent 4a2d73a commit bb0ad19

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

net/ipv6/fib6_rules.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,17 @@ static int fib6_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
223223
if (r->tclass && r->tclass != ip6_tclass(fl6->flowlabel))
224224
return 0;
225225

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+
226237
return 1;
227238
}
228239

0 commit comments

Comments
 (0)