]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use the correct API here.
authorAlan T. DeKok <aland@freeradius.org>
Wed, 21 Dec 2022 15:24:59 +0000 (10:24 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 21 Dec 2022 17:49:18 +0000 (12:49 -0500)
There's no need to create a vendor intermediary

src/lib/util/struct.c

index a359fa0c083ba601ec37af3133cf6564635f5b46..1bc13fbc76a67985324e99de695e450ecc139252 100644 (file)
@@ -339,13 +339,14 @@ ssize_t fr_struct_from_network(TALLOC_CTX *ctx, fr_pair_list_t *out,
                if (!child) {
                unknown_child:
                        /*
-                        *      Encode the unknown child as attribute
-                        *      number 0.  This choice means we don't
-                        *      have to look up, or keep track of, the
-                        *      number of children of the key field.
+                        *      Always encode the unknown child as
+                        *      attribute number 0.  Since the unknown
+                        *      children have no "real" number, and
+                        *      are all unique da's, they are
+                        *      incomparable.  And thus can all be
+                        *      given the same number.
                         */
-                       child = fr_dict_unknown_afrom_fields(child_ctx, key_vp->da,
-                                                            fr_dict_vendor_num_by_da(key_vp->da), 0);
+                       child = fr_dict_unknown_attr_afrom_num(child_ctx, key_vp->da, 0);
                        if (!child) {
                                FR_PROTO_TRACE("failed allocating unknown child?");
                                goto unknown;