Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/cxgbei/icl_cxgbei.c
Show First 20 Lines • Show All 618 Lines • ▼ Show 20 Lines | icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) | ||||
MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); | MPASS(icc->icc_signature == CXGBEI_CONN_SIGNATURE); | ||||
ICL_CONN_LOCK_ASSERT_NOT(ic); | ICL_CONN_LOCK_ASSERT_NOT(ic); | ||||
/* | /* | ||||
* Steal the socket from userland. | * Steal the socket from userland. | ||||
*/ | */ | ||||
error = fget(curthread, fd, | error = fget(curthread, fd, | ||||
cap_rights_init(&rights, CAP_SOCK_CLIENT), &fp); | cap_rights_init_one(&rights, CAP_SOCK_CLIENT), &fp); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
if (fp->f_type != DTYPE_SOCKET) { | if (fp->f_type != DTYPE_SOCKET) { | ||||
fdrop(fp, curthread); | fdrop(fp, curthread); | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
so = fp->f_data; | so = fp->f_data; | ||||
if (so->so_type != SOCK_STREAM || | if (so->so_type != SOCK_STREAM || | ||||
▲ Show 20 Lines • Show All 463 Lines • Show Last 20 Lines |