From 68e6f4213cc0e375ff9451e8c0670926b07f922e Mon Sep 17 00:00:00 2001 From: brueffer Date: Tue, 21 Jul 2015 14:27:36 +0000 Subject: [PATCH] MFC: r285529 If ggated's exports_find() fails, the connection is removed before (trying to) report the problem to the client. sendfail() is called with an already closed socket and thus it fails to inform the client about the problem. Fix this by calling sendfail() before connection_remove(). PR: 195944 Submitted by: Fabian Keil Reviewed by: pjd Approved by: re (gjb) --- ggated/ggated.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ggated/ggated.c b/ggated/ggated.c index 01aa00a..a340f01 100644 --- a/ggated/ggated.c +++ b/ggated/ggated.c @@ -906,8 +906,8 @@ handshake(struct sockaddr *from, int sfd) ex = exports_find(from, &cinit, conn); if (ex == NULL) { - connection_remove(conn); sendfail(sfd, errno, NULL); + connection_remove(conn); return (0); } if (conn->c_mediasize == 0) {