]> granicus.if.org Git - ipset/commitdiff
Disable type revisions which are not supported both by the kernel and ipset
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 13 May 2011 21:47:56 +0000 (23:47 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Fri, 13 May 2011 21:47:56 +0000 (23:47 +0200)
lib/types.c

index 402e726def09cdd53e868f21061cf6c57dfa8461..c440993408124a770d67cb3c808c5b0fe3304d9a 100644 (file)
@@ -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);