winbind: Use forall_children in winbind_msg_ip_dropped_parent()
authorVolker Lendecke <vl@samba.org>
Mon, 26 Feb 2018 12:37:05 +0000 (13:37 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 1 Mar 2018 08:53:45 +0000 (09:53 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13309

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/winbindd_dual.c

index c4047326a494a66fa167bcf34ad7b8699bdf92d4..f9b3661a3ad61caa97b9e77923399c70db6cb813 100644 (file)
@@ -1793,14 +1793,14 @@ void winbind_msg_ip_dropped_parent(struct messaging_context *msg_ctx,
                                   struct server_id server_id,
                                   DATA_BLOB *data)
 {
-       struct winbindd_child *child;
+       struct winbind_msg_relay_state state = {
+               .msg_ctx = msg_ctx,
+               .msg_type = msg_type,
+               .data = data,
+       };
 
        winbind_msg_ip_dropped(msg_ctx, private_data, msg_type,
                               server_id, data);
 
-
-       for (child = winbindd_children; child != NULL; child = child->next) {
-               messaging_send_buf(msg_ctx, pid_to_procid(child->pid),
-                                  msg_type, data->data, data->length);
-       }
+       forall_children(winbind_msg_relay_fn, &state);
 }