]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ipfw: close(2) instead shutdown(2) of the divert(4) socket
authorGleb Smirnoff <glebius@FreeBSD.org>
Thu, 11 Jan 2024 21:35:21 +0000 (13:35 -0800)
committerVictor Julien <victor@inliniac.net>
Mon, 15 Jan 2024 16:49:11 +0000 (17:49 +0100)
The shutdown(2) syscall would always return ENOTCONN for FreeBSD 11,
FreeBSD 12, FreeBSD 13 and FreeBSD 14.  It could do some action on the
socket in the kernel in FreeBSD 10 and before, did not test.

src/source-ipfw.c

index 6d0f67c11572f753446b2f6da7dedc380ddacf7c..4bdb7724598a504a08f618a136f4ec4d9e96c091 100644 (file)
@@ -412,8 +412,7 @@ TmEcode ReceiveIPFWThreadDeinit(ThreadVars *tv, void *data)
 
     SCEnter();
 
-    /* Attempt to shut the socket down...close instead? */
-    if (shutdown(nq->fd, SHUT_RD) < 0) {
+    if (close(nq->fd) < 0) {
         SCLogWarning("Unable to disable ipfw socket: %s", strerror(errno));
         SCReturnInt(TM_ECODE_FAILED);
     }