]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
comments
authorAlan T. DeKok <aland@freeradius.org>
Fri, 18 Nov 2022 14:38:30 +0000 (09:38 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 21 Nov 2022 15:51:08 +0000 (10:51 -0500)
src/lib/util/edit.c

index b7866d3155d48de584ed09ea120cec53af944e11..3070a87861b41f7121ac82dee5ee240e5a2843a1 100644 (file)
@@ -826,6 +826,10 @@ int fr_edit_list_insert_list_after(fr_edit_list_t *el, fr_pair_list_t *list, fr_
  */
 static int fr_edit_list_delete_list(fr_edit_list_t *el, fr_pair_list_t *list, fr_pair_list_t *to_remove)
 {
+       /*
+        *      We have a list of VPs with operators and values.  Those contain the list of things we want to
+        *      be removed from the main "list".
+        */
        fr_pair_list_foreach(to_remove, vp) {
                fr_pair_t *found, *next;
 
@@ -834,6 +838,9 @@ static int fr_edit_list_delete_list(fr_edit_list_t *el, fr_pair_list_t *list, fr
                 */
                if (fr_type_is_structural(vp->da->type)) continue;
 
+               /*
+                *      Search the list to edit for VPs which match the ones we're trying to delete.
+                */
                for (found = fr_pair_find_by_da(list, NULL, vp->da);
                     found != NULL;
                     found = next) {
@@ -841,6 +848,9 @@ static int fr_edit_list_delete_list(fr_edit_list_t *el, fr_pair_list_t *list, fr
 
                        next = fr_pair_find_by_da(list, found, vp->da);
 
+                       /*
+                        *      It doesn't match, keep it.  If it matches, delete it.
+                        */
                        rcode = fr_value_box_cmp_op(vp->op, &vp->data, &found->data);
                        if (rcode < 0) return -1;