]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
use parent sequence number in child name
authorAlan T. DeKok <aland@freeradius.org>
Wed, 17 Feb 2021 13:58:22 +0000 (08:58 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 17 Feb 2021 13:58:22 +0000 (08:58 -0500)
so that we don't have multiple children labelled with the same
name

src/lib/server/request.c

index 7b86ded0cd1faf32ae76f0c5a64a492805d07040..c1a7ae44c5ce91326898d3af941f299a8988c007 100644 (file)
@@ -123,7 +123,13 @@ static inline CC_HINT(always_inline) int request_detachable_init(request_t *chil
 static inline CC_HINT(always_inline) int request_child_init(request_t *child, request_t *parent)
 {
        child->number = parent->child_number++;
-       child->name = talloc_typed_asprintf(child, "%s.%" PRIu64 , parent->name, child->number);
+
+       if ((parent->seq_start == 0) || (parent->number == parent->seq_start)) {
+               child->name = talloc_typed_asprintf(child, "%s.%" PRIu64, parent->name, child->number);
+       } else {
+               child->name = talloc_typed_asprintf(child, "(%s,%" PRIu64 ").%" PRIu64,
+                                                  parent->name, parent->seq_start, child->number);
+       }
        child->seq_start = 0;   /* children always start with their own sequence */
        child->parent = parent;
        child->dict = parent->dict;