--- Comment #9 from Jonathan T. Looney <> ---
My best guess is that this is due to a new check in soshutdown() added in


2351            if ((so->so_state &
0) {
2353                    /*
2354                     * POSIX mandates us to return ENOTCONN when
shutdown(2) is
2355                     * invoked on a datagram sockets, however historically
we would
2356                     * actually tear socket down. This is known to be
leveraged by
2357                     * some applications to unblock process waiting in
2358                     * by other process that it shares that socket with.
Try to meet
2359                     * both backward-compatibility and POSIX requirements
by forcing
2360                     * ENOTCONN but still asking protocol to perform
2361                     */
2362                    if (so->so_type != SOCK_DGRAM)
2363                            return (ENOTCONN);
2364                    soerror_enotconn = 1;
2365            }

I don't think I ever really considered someone calling shutdown() on a
listening socket. I would have expected them to use close(). My guess is that
whoever added this didn't consider that case, either.

FWIW, this check was added in r285910.

I suppose the simple fix is to add a check for SOLISTENING(so) (head) or
so->so_options & SO_ACCEPTCON (stable/11). However, we should consult with
someone to see what POSIX requires in this case.

You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________ mailing list
To unsubscribe, send any mail to ""

Reply via email to