Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/tcp_usrreq.c
Show First 20 Lines • Show All 1,515 Lines • ▼ Show 20 Lines | if ((sopt->sopt_dir == SOPT_SET) && | ||||
*/ | */ | ||||
if (tp->t_fb->tfb_tcp_fb_fini) { | if (tp->t_fb->tfb_tcp_fb_fini) { | ||||
/* | /* | ||||
* Tell the stack to cleanup with 0 i.e. | * Tell the stack to cleanup with 0 i.e. | ||||
* the tcb is not going away. | * the tcb is not going away. | ||||
*/ | */ | ||||
(*tp->t_fb->tfb_tcp_fb_fini)(tp, 0); | (*tp->t_fb->tfb_tcp_fb_fini)(tp, 0); | ||||
} | } | ||||
refcount_release(&tp->t_fb->tfb_refcnt); | #ifdef TCPHPTS | ||||
tp->t_fb = blk; | /* Assure that we are not on any hpts */ | ||||
tcp_hpts_remove(tp->t_inpcb, HPTS_REMOVE_ALL); | |||||
#endif | |||||
if (blk->tfb_tcp_fb_init) { | |||||
error = (*blk->tfb_tcp_fb_init)(tp); | |||||
if (error) { | |||||
refcount_release(&blk->tfb_refcnt); | |||||
if (tp->t_fb->tfb_tcp_fb_init) { | if (tp->t_fb->tfb_tcp_fb_init) { | ||||
(*tp->t_fb->tfb_tcp_fb_init)(tp); | if((*tp->t_fb->tfb_tcp_fb_init)(tp) != 0) { | ||||
/* Fall back failed, drop the connection */ | |||||
INP_WUNLOCK(inp); | |||||
soabort(so); | |||||
return(error); | |||||
} | } | ||||
} | |||||
goto err_out; | |||||
} | |||||
} | |||||
refcount_release(&tp->t_fb->tfb_refcnt); | |||||
tp->t_fb = blk; | |||||
#ifdef TCP_OFFLOAD | #ifdef TCP_OFFLOAD | ||||
if (tp->t_flags & TF_TOE) { | if (tp->t_flags & TF_TOE) { | ||||
tcp_offload_ctloutput(tp, sopt->sopt_dir, | tcp_offload_ctloutput(tp, sopt->sopt_dir, | ||||
sopt->sopt_name); | sopt->sopt_name); | ||||
} | } | ||||
#endif | #endif | ||||
err_out: | |||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
return (error); | return (error); | ||||
} else if ((sopt->sopt_dir == SOPT_GET) && | } else if ((sopt->sopt_dir == SOPT_GET) && | ||||
(sopt->sopt_name == TCP_FUNCTION_BLK)) { | (sopt->sopt_name == TCP_FUNCTION_BLK)) { | ||||
strncpy(fsn.function_set_name, tp->t_fb->tfb_tcp_block_name, | strncpy(fsn.function_set_name, tp->t_fb->tfb_tcp_block_name, | ||||
TCP_FUNCTION_NAME_LEN_MAX); | TCP_FUNCTION_NAME_LEN_MAX); | ||||
fsn.function_set_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; | fsn.function_set_name[TCP_FUNCTION_NAME_LEN_MAX - 1] = '\0'; | ||||
fsn.pcbcnt = tp->t_fb->tfb_refcnt; | fsn.pcbcnt = tp->t_fb->tfb_refcnt; | ||||
▲ Show 20 Lines • Show All 938 Lines • Show Last 20 Lines |