tcp_usr_connect: report actual error code when stack requests drop

This commit is contained in:
Gleb Smirnoff 2022-01-13 10:32:41 -08:00
parent 3284f4925f
commit 1d41a49404

View file

@ -594,8 +594,8 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
#endif
tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp));
error = tcp_output(tp);
KASSERT(error >= 0, ("TCP stack %s requested tcp_drop(%p) at connect()",
tp->t_fb->tfb_tcp_block_name, tp));
KASSERT(error >= 0, ("TCP stack %s requested tcp_drop(%p) at connect()"
", error code %d", tp->t_fb->tfb_tcp_block_name, tp, -error));
out_in_epoch:
NET_EPOCH_EXIT(et);
out:
@ -722,8 +722,8 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
#endif
NET_EPOCH_EXIT(et);
out:
KASSERT(error >= 0, ("TCP stack %s requested tcp_drop(%p) at connect()",
tp->t_fb->tfb_tcp_block_name, tp));
KASSERT(error >= 0, ("TCP stack %s requested tcp_drop(%p) at connect()"
", error code %d", tp->t_fb->tfb_tcp_block_name, tp, -error));
/*
* If the implicit bind in the connect call fails, restore
* the flags we modified.