From: Alan T. DeKok Date: Fri, 1 Aug 2025 18:36:40 +0000 (-0400) Subject: add notes about attribute comparisons X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e67b1adaaae616995455a283515869026f777eac;p=thirdparty%2Ffreeradius-server.git add notes about attribute comparisons --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index ba409f1f72..7517bb78d0 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -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); /* diff --git a/src/protocols/dhcpv4/base.c b/src/protocols/dhcpv4/base.c index cfb70263fe..60bdd732ec 100644 --- a/src/protocols/dhcpv4/base.c +++ b/src/protocols/dhcpv4/base.c @@ -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;