diff --git a/freebsd/netinet/tcp_usrreq.c b/freebsd/netinet/tcp_usrreq.c index b932beecc..57c7bc18f 100644 --- a/freebsd/netinet/tcp_usrreq.c +++ b/freebsd/netinet/tcp_usrreq.c @@ -1321,19 +1321,20 @@ tcp_connect(struct tcpcb *tp, struct sockaddr *nam, struct thread *td) error = EADDRINUSE; goto out; } - // inp->inp_lport != lport means in_pcbconnect_setup selected new port to inp->inp_lport. - // inp will inhash. + + // inp->inp_lport != lport means in_pcbconnect_setup selected new port to inp->inp_lport. + // inp will inhash. if (in_pcbinshash(inp) != 0) { - inp->inp_laddr.s_addr = INADDR_ANY; - inp->inp_lport = 0; - return (EAGAIN); - } + inp->inp_laddr.s_addr = INADDR_ANY; + inp->inp_lport = 0; + return (EAGAIN); + } } else { - // app call bind() and connect(), lport is set when bind, and the inp is inhashed in bind() function. - // in_pcbconnect_setup() update inp->inp_faddr/inp->inp_fport, so inp should be rehashed. - in_pcbrehash(inp); + // app call bind() and connect(), lport is set when bind, and the inp is inhashed in bind() function. + // in_pcbconnect_setup() update inp->inp_faddr/inp->inp_fport, so inp should be rehashed. + in_pcbrehash(inp); } if (anonport) {