svn commit: r285529 - head/sbin/ggate/ggated

Christian Brueffer brueffer at FreeBSD.org
Tue Jul 14 09:25:11 UTC 2015


Author: brueffer
Date: Tue Jul 14 09:25:10 2015
New Revision: 285529
URL: https://svnweb.freebsd.org/changeset/base/285529

Log:
  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
  MFC after:	1 week

Modified:
  head/sbin/ggate/ggated/ggated.c

Modified: head/sbin/ggate/ggated/ggated.c
==============================================================================
--- head/sbin/ggate/ggated/ggated.c	Tue Jul 14 09:13:18 2015	(r285528)
+++ head/sbin/ggate/ggated/ggated.c	Tue Jul 14 09:25:10 2015	(r285529)
@@ -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) {


More information about the svn-src-head mailing list