From 774c80b578172aa7797ea60264e8a929302d5e83 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Fri, 13 May 2011 23:47:56 +0200 Subject: Disable type revisions which are not supported both by the kernel and ipset --- lib/types.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/types.c') 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); -- cgit v1.2.3