diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -85,6 +85,7 @@ #include #include #include +#include #include #include #include @@ -1008,6 +1009,20 @@ tod->tod_offload_socket(tod, sc->sc_todctx, so); } +#endif +#ifdef TCP_BLACKBOX + /* + * Inherit the log state from the listening socket, if + * - the log state of the listening socket is not off and + * - the listening socket was not auto selected from all sessions and + * - a log id is not set on the listening socket. + * This avoids inheriting a log state which was automatically set. + */ + if ((sototcpcb(lso)->t_logstate != TCP_LOG_STATE_OFF) && + ((sototcpcb(lso)->t_flags2 & TF2_LOG_AUTO) == 0) && + (sototcpcb(lso)->t_lib == NULL)) { + tcp_log_state_change(tp, sototcpcb(lso)->t_logstate); + } #endif /* * Copy and activate timers.