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.

(cherry picked from commit b239e88c93)
pull/10253/head
Gleb Smirnoff 2 years ago committed by Victor Julien
parent 08dae40452
commit e6646c8f3f

@ -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