]> 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>
Thu, 25 Jan 2024 12:18:04 +0000 (13:18 +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.

(cherry picked from commit b239e88c9303d83a3074ed69c4989bd136bbf8b4)

src/source-ipfw.c

index 75bd738fee02bc823a93ad8c8f8bf936349cf7a5..7f31de71a84aeb85115fda104d29f1b30d6d849e 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);
     }