diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -97,6 +97,12 @@ return (EOPNOTSUPP); } +static int +pr_ctloutput_notsupp(struct socket *so, struct sockopt *sopt) +{ + return (ENOPROTOOPT); +} + static int pr_disconnect_notsupp(struct socket *so) { @@ -194,6 +200,7 @@ NOTSUPP(pr_connect2); NOTSUPP(pr_connectat); NOTSUPP(pr_control); + NOTSUPP(pr_ctloutput); NOTSUPP(pr_disconnect); NOTSUPP(pr_listen); NOTSUPP(pr_peeraddr); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3804,10 +3804,7 @@ CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto->pr_ctloutput != NULL) - error = (*so->so_proto->pr_ctloutput)(so, sopt); - else - error = ENOPROTOOPT; + error = (*so->so_proto->pr_ctloutput)(so, sopt); } else { switch (sopt->sopt_name) { case SO_ACCEPTFILTER: @@ -4017,7 +4014,7 @@ error = ENOPROTOOPT; break; } - if (error == 0 && so->so_proto->pr_ctloutput != NULL) + if (error == 0) (void)(*so->so_proto->pr_ctloutput)(so, sopt); } bad: @@ -4068,10 +4065,7 @@ CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto->pr_ctloutput != NULL) - error = (*so->so_proto->pr_ctloutput)(so, sopt); - else - error = ENOPROTOOPT; + error = (*so->so_proto->pr_ctloutput)(so, sopt); CURVNET_RESTORE(); return (error); } else {