Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jun 2017 06:13:53 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319684 - head/tools/regression/sockets/accf_data_attach
Message-ID:  <201706080613.v586Dr50020069@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Thu Jun  8 06:13:53 2017
New Revision: 319684
URL: https://svnweb.freebsd.org/changeset/base/319684

Log:
  Make the test to leave one connection on the incomplete queue
  before exiting.  This examines some race conditions in kernel.

Modified:
  head/tools/regression/sockets/accf_data_attach/accf_data_attach.c

Modified: head/tools/regression/sockets/accf_data_attach/accf_data_attach.c
==============================================================================
--- head/tools/regression/sockets/accf_data_attach/accf_data_attach.c	Thu Jun  8 05:12:11 2017	(r319683)
+++ head/tools/regression/sockets/accf_data_attach/accf_data_attach.c	Thu Jun  8 06:13:53 2017	(r319684)
@@ -233,6 +233,20 @@ main(void)
 		errx(-1, "not ok 11 - accept #2 %s", strerror(errno));
 	printf("ok 11 - accept\n");
 
+#if 1
+	/*
+	 * XXXGL: this doesn't belong to the test itself, but is known
+	 * to examine rarely examined paths in the kernel.  Intentionally
+	 * leave a socket on the incomplete queue, before the program
+	 * exits.
+	 */
+	so = socket(PF_INET, SOCK_STREAM, 0);
+	if (so == -1)
+		errx(-1, "not ok 12 - socket: %s", strerror(errno));
+	if (connect(so, (struct sockaddr *)&sin, sizeof(sin)) < 0)
+		errx(-1, "not ok 12 - connect %s", strerror(errno));
+#endif
+
 	/*
 	 * Step 11: Remove accept filter.  After removing the accept filter
 	 * getsockopt() should fail with EINVAL.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706080613.v586Dr50020069>