diff options
author | Nikolay Aleksandrov <nikolay@cumulusnetworks.com> | 2019-06-27 11:10:47 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-29 21:15:12 +0300 |
commit | 0c4231c784b4a0435a31f42451c66186c6e43170 (patch) | |
tree | 68c9485351563c22c6ef2d5d7fc2d0ef66d38be6 /net/sched | |
parent | ba3d24d48ffd6c787a1c745784484dc3c2f16119 (diff) | |
download | linux-0c4231c784b4a0435a31f42451c66186c6e43170.tar.xz |
net: sched: em_ipt: add support for addrtype matching
Allow em_ipt to use addrtype for matching. Restrict the use only to
revision 1 which has IPv6 support. Since it's a NFPROTO_UNSPEC xt match
we use the user-specified nfproto for matching, in case it's unspecified
both v4/v6 will be matched by the rule.
v2: no changes, was patch 5 in v1
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r-- | net/sched/em_ipt.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/sched/em_ipt.c b/net/sched/em_ipt.c index 3c356d6f719a..9fff6480acc6 100644 --- a/net/sched/em_ipt.c +++ b/net/sched/em_ipt.c @@ -72,11 +72,25 @@ static int policy_validate_match_data(struct nlattr **tb, u8 mrev) return 0; } +static int addrtype_validate_match_data(struct nlattr **tb, u8 mrev) +{ + if (mrev != 1) { + pr_err("only addrtype match revision 1 supported"); + return -EINVAL; + } + + return 0; +} + static const struct em_ipt_xt_match em_ipt_xt_matches[] = { { .match_name = "policy", .validate_match_data = policy_validate_match_data }, + { + .match_name = "addrtype", + .validate_match_data = addrtype_validate_match_data + }, {} }; |