]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
do dup checks on the correct field
authorAlan T. DeKok <aland@freeradius.org>
Tue, 8 May 2018 20:57:05 +0000 (16:57 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 8 May 2018 20:57:58 +0000 (16:57 -0400)
src/modules/proto_vmps/proto_vmps_udp.c

index 4a75dc7130d3f68d3edc4f07f650984acd9a6a92..56e5a89ad5541823ce231cfa3df69c8943181756 100644 (file)
@@ -400,21 +400,19 @@ static int mod_fd(void const *instance)
 static int mod_compare(UNUSED void const *instance, void const *one, void const *two)
 {
        int rcode;
-
        uint8_t const *a = one;
        uint8_t const *b = two;
 
        /*
-        *      The tree is ordered by IDs, which are (hopefully)
-        *      pseudo-randomly distributed.
+        *      Order by transaction ID
         */
-       rcode = (a[1] < b[1]) - (a[1] > b[1]);
+       rcode = memcmp(a + 4, b + 4, 4);
        if (rcode != 0) return rcode;
 
        /*
-        *      Then ordered by code, which is usally the same.
+        *      Then ordered by opcode, which is usally the same.
         */
-       return (a[0] < b[0]) - (a[0] > b[0]);
+       return (a[1] < b[1]) - (a[1] > b[1]);
 }