]> granicus.if.org Git - ipset/commitdiff
Fix revision reporting
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Sat, 19 Mar 2011 10:13:20 +0000 (11:13 +0100)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Sat, 19 Mar 2011 10:13:20 +0000 (11:13 +0100)
Revision reporting got broken by the revision checking patch, fixed.

kernel/net/netfilter/ipset/ip_set_core.c
lib/types.c

index 295c80386092f17f750acc69f5f2b6cda5c3e85f..237fc2a60cff33b01583d660d01d630224787cac 100644 (file)
@@ -136,7 +136,7 @@ find_set_type_minmax(const char *name, u8 family, u8 *min, u8 *max)
                        found = true;
                        if (type->revision < *min)
                                *min = type->revision;
-                       else if (type->revision > *max)
+                       if (type->revision > *max)
                                *max = type->revision;
                }
        rcu_read_unlock();
index f0dbbc917bc54dce4e7c6ac94352ab40e674507b..402e726def09cdd53e868f21061cf6c57dfa8461 100644 (file)
@@ -216,7 +216,7 @@ create_type_get(struct ipset_session *session)
                    && MATCH_FAMILY(t, family)) {
                        if (match == NULL) {
                                match = t;
-                               tmax = t->revision;
+                               tmin = tmax = t->revision;
                        } else if (t->family == match->family)
                                tmin = t->revision;
                }       
@@ -240,11 +240,10 @@ create_type_get(struct ipset_session *session)
        if (ret != 0)
                return NULL;
 
-       kmax = *(const uint8_t *)ipset_data_get(data, IPSET_OPT_REVISION);
+       kmin = kmax = *(const uint8_t *)ipset_data_get(data, IPSET_OPT_REVISION);
        if (ipset_data_test(data, IPSET_OPT_REVISION_MIN))
                kmin = *(const uint8_t *)ipset_data_get(data, IPSET_OPT_REVISION_MIN);
-       else
-               kmin = kmax;
+
        if (MAX(tmin, kmin) > MIN(tmax, kmax)) {
                if (kmin > tmax)
                        return ipset_errptr(session,