messaging: Ignore messages from ourselves
authorVolker Lendecke <vl@samba.org>
Fri, 8 Dec 2017 16:21:37 +0000 (17:21 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 12 Dec 2017 19:37:08 +0000 (20:37 +0100)
For non-clustered messaging this should have never gone through the socket, we
should have caught it before in messaging_send_iov_from.

It can come in on a socket from ctdb when broadcasting in clustered mode. There
ctdb does the broadcasting.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/messages.c

index 561616df6e44da9c989f90253cf2fc534a22422c..464233fda2c3d0b0e9b4af97ca025d8aa5484884 100644 (file)
@@ -399,6 +399,11 @@ static void messaging_recv_cb(struct tevent_context *ev,
                  (unsigned)rec.msg_type, rec.buf.length, num_fds,
                  server_id_str_buf(rec.src, &idbuf));
 
+       if (server_id_same_process(&rec.src, &msg_ctx->id)) {
+               DBG_DEBUG("Ignoring self-send\n");
+               goto close_fail;
+       }
+
        messaging_dispatch_rec(msg_ctx, ev, &rec);
        return;