diff options
author | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-05-13 23:47:56 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2011-05-13 23:47:56 +0200 |
commit | 774c80b578172aa7797ea60264e8a929302d5e83 (patch) | |
tree | bc32059b3f5604f77dab62ec22068185b9eb4b03 /lib/types.c | |
parent | da2f1228b4919a6318c7ee7ea18b708365737956 (diff) |
Disable type revisions which are not supported both by the kernel and ipset
Diffstat (limited to 'lib/types.c')
-rw-r--r-- | lib/types.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/types.c b/lib/types.c index 402e726..c440993 100644 --- a/lib/types.c +++ b/lib/types.c @@ -267,6 +267,19 @@ create_type_get(struct ipset_session *session) kmax, tmin); } + /* Disable unsupported revisions */ + for (match = NULL, t = typelist; t != NULL; t = t->next) { + /* Skip revisions which are unsupported by the kernel */ + if (t->kernel_check == IPSET_KERNEL_MISMATCH) + continue; + if (ipset_match_typename(typename, t) + && MATCH_FAMILY(t, family)) { + if (t->revision < kmin || t->revision > kmax) + t->kernel_check = IPSET_KERNEL_MISMATCH; + else if (match == NULL) + match = t; + } + } match->kernel_check = IPSET_KERNEL_OK; found: ipset_data_set(data, IPSET_OPT_TYPE, match); |