From b239e88c9303d83a3074ed69c4989bd136bbf8b4 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Thu, 11 Jan 2024 13:35:21 -0800 Subject: [PATCH] ipfw: close(2) instead shutdown(2) of the divert(4) socket 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/source-ipfw.c b/src/source-ipfw.c index 6d0f67c115..4bdb772459 100644 --- a/src/source-ipfw.c +++ b/src/source-ipfw.c @@ -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); }