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.
pull/10167/head
Gleb Smirnoff 1 year ago committed by Victor Julien
parent adf5e6da7b
commit b239e88c93

@ -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);
}

Loading…
Cancel
Save