Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/uipc_socket.c
Show First 20 Lines • Show All 3,798 Lines • ▼ Show 20 Lines | sosetopt(struct socket *so, struct sockopt *sopt) | ||||
uint32_t val32; | uint32_t val32; | ||||
#ifdef MAC | #ifdef MAC | ||||
struct mac extmac; | struct mac extmac; | ||||
#endif | #endif | ||||
CURVNET_SET(so->so_vnet); | CURVNET_SET(so->so_vnet); | ||||
error = 0; | error = 0; | ||||
if (sopt->sopt_level != SOL_SOCKET) { | if (sopt->sopt_level != SOL_SOCKET) { | ||||
if (so->so_proto->pr_ctloutput != NULL) | |||||
error = (*so->so_proto->pr_ctloutput)(so, sopt); | error = (*so->so_proto->pr_ctloutput)(so, sopt); | ||||
else | |||||
error = ENOPROTOOPT; | |||||
} else { | } else { | ||||
switch (sopt->sopt_name) { | switch (sopt->sopt_name) { | ||||
case SO_ACCEPTFILTER: | case SO_ACCEPTFILTER: | ||||
error = accept_filt_setopt(so, sopt); | error = accept_filt_setopt(so, sopt); | ||||
if (error) | if (error) | ||||
goto bad; | goto bad; | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | #ifdef SOCKET_HHOOK | ||||
if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0) | if (V_socket_hhh[HHOOK_SOCKET_OPT]->hhh_nhooks > 0) | ||||
error = hhook_run_socket(so, sopt, | error = hhook_run_socket(so, sopt, | ||||
HHOOK_SOCKET_OPT); | HHOOK_SOCKET_OPT); | ||||
else | else | ||||
#endif | #endif | ||||
error = ENOPROTOOPT; | error = ENOPROTOOPT; | ||||
break; | break; | ||||
} | } | ||||
if (error == 0 && so->so_proto->pr_ctloutput != NULL) | if (error == 0) | ||||
(void)(*so->so_proto->pr_ctloutput)(so, sopt); | (void)(*so->so_proto->pr_ctloutput)(so, sopt); | ||||
} | } | ||||
bad: | bad: | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
Show All 34 Lines | sogetopt(struct socket *so, struct sockopt *sopt) | ||||
struct timeval tv; | struct timeval tv; | ||||
#ifdef MAC | #ifdef MAC | ||||
struct mac extmac; | struct mac extmac; | ||||
#endif | #endif | ||||
CURVNET_SET(so->so_vnet); | CURVNET_SET(so->so_vnet); | ||||
error = 0; | error = 0; | ||||
if (sopt->sopt_level != SOL_SOCKET) { | if (sopt->sopt_level != SOL_SOCKET) { | ||||
if (so->so_proto->pr_ctloutput != NULL) | |||||
error = (*so->so_proto->pr_ctloutput)(so, sopt); | error = (*so->so_proto->pr_ctloutput)(so, sopt); | ||||
else | |||||
error = ENOPROTOOPT; | |||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
return (error); | return (error); | ||||
} else { | } else { | ||||
switch (sopt->sopt_name) { | switch (sopt->sopt_name) { | ||||
case SO_ACCEPTFILTER: | case SO_ACCEPTFILTER: | ||||
error = accept_filt_getopt(so, sopt); | error = accept_filt_getopt(so, sopt); | ||||
break; | break; | ||||
▲ Show 20 Lines • Show All 1,008 Lines • Show Last 20 Lines |