Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_subr.c
Show First 20 Lines • Show All 792 Lines • ▼ Show 20 Lines | if ((blk->tfb_tcp_timer_stop_all == NULL) || | ||||
(blk->tfb_tcp_timer_activate == NULL) || | (blk->tfb_tcp_timer_activate == NULL) || | ||||
(blk->tfb_tcp_timer_active == NULL) || | (blk->tfb_tcp_timer_active == NULL) || | ||||
(blk->tfb_tcp_timer_stop == NULL)) { | (blk->tfb_tcp_timer_stop == NULL)) { | ||||
*num_names = 0; | *num_names = 0; | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
} | } | ||||
if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) { | |||||
*num_names = 0; | |||||
return (EINVAL); | |||||
} | |||||
refcount_init(&blk->tfb_refcnt, 0); | refcount_init(&blk->tfb_refcnt, 0); | ||||
blk->tfb_flags = 0; | |||||
blk->tfb_id = atomic_fetchadd_int(&next_tcp_stack_id, 1); | blk->tfb_id = atomic_fetchadd_int(&next_tcp_stack_id, 1); | ||||
for (i = 0; i < *num_names; i++) { | for (i = 0; i < *num_names; i++) { | ||||
n = malloc(sizeof(struct tcp_function), M_TCPFUNCTIONS, wait); | n = malloc(sizeof(struct tcp_function), M_TCPFUNCTIONS, wait); | ||||
if (n == NULL) { | if (n == NULL) { | ||||
error = ENOMEM; | error = ENOMEM; | ||||
goto cleanup; | goto cleanup; | ||||
} | } | ||||
n->tf_fb = blk; | n->tf_fb = blk; | ||||
▲ Show 20 Lines • Show All 2,436 Lines • Show Last 20 Lines |