projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bfff486
)
ipv4: fib_rules: support match on sport, dport and ip proto
author
Roopa Prabhu
<
[email protected]
>
Thu, 1 Mar 2018 03:41:06 +0000
(22:41 -0500)
committer
David S. Miller
<
[email protected]
>
Thu, 1 Mar 2018 03:44:43 +0000
(22:44 -0500)
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]
>
net/ipv4/fib_rules.c
patch
|
blob
|
history
diff --git
a/net/ipv4/fib_rules.c
b/net/ipv4/fib_rules.c
index 35d646a62ad454ddced6a614dc7e10b67447a3f0..16083b82954bff13c6c74a94df9f5b3ee68e74b4 100644
(file)
--- a/
net/ipv4/fib_rules.c
+++ b/
net/ipv4/fib_rules.c
@@
-182,6
+182,17
@@
static int fib4_rule_match(struct fib_rule *rule, struct flowi *fl, int flags)
if (r->tos && (r->tos != fl4->flowi4_tos))
return 0;
+ if (rule->ip_proto && (rule->ip_proto != fl4->flowi4_proto))
+ return 0;
+
+ if (fib_rule_port_range_set(&rule->sport_range) &&
+ !fib_rule_port_inrange(&rule->sport_range, fl4->fl4_sport))
+ return 0;
+
+ if (fib_rule_port_range_set(&rule->dport_range) &&
+ !fib_rule_port_inrange(&rule->dport_range, fl4->fl4_dport))
+ return 0;
+
return 1;
}