]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add notes about attribute comparisons
authorAlan T. DeKok <aland@freeradius.org>
Fri, 1 Aug 2025 18:36:40 +0000 (14:36 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 1 Aug 2025 18:36:40 +0000 (14:36 -0400)
src/lib/util/value.c
src/protocols/dhcpv4/base.c

index ba409f1f721c64db50bda6b85448384ddccb6d57..7517bb78d0ef5d32c55eed27d25642cc6a0d3775 100644 (file)
@@ -850,6 +850,14 @@ int8_t fr_value_box_cmp(fr_value_box_t const *a, fr_value_box_t const *b)
                return -2;
 
        case FR_TYPE_ATTR:
+               /*
+                *      @todo - this makes things _distinct_, but doesn't provide a _full_ order.  We
+                *      generally don't need a full ordering for attributes.
+                *
+                *      The need to call fr_dict_attr_cmp() here is for comparing raw / unknown attributes
+                *      which come from xlats.  Unknown / raw attributes which are in policies are added to
+                *      the dictionaries when the server starts, and are thus known.
+                */
                return fr_dict_attr_cmp(a->vb_attr, b->vb_attr);
 
        /*
index cfb70263fe041fa7c1b5d2e2d102b0f7af1e1e77..60bdd732ecae9b0ed97288de0f251abf6e84538b 100644 (file)
@@ -194,6 +194,11 @@ static fr_dict_flag_parser_t const dhcpv4_flags[] = {
        { L("prefix"),          { .func = dict_flag_prefix } }
 };
 
+/*
+ *     @todo - arguably we don't want to mutate the input list.
+ *     Instead, the encoder should just do 3 passes, where middle one
+ *     ignores the message-type and option 82.
+ */
 int8_t fr_dhcpv4_attr_cmp(void const *a, void const *b)
 {
        fr_pair_t const *my_a = a, *my_b = b;