FreeBSD Bugzilla – Attachment 150662 Details for
Bug 196035
Subsequent connect on ready socket returns EINVAL instead of ECONNREFUSED
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Updated Patch to return EADDRINUSE on TIME_WAIT instead of EALREADY
tcp_usrreq.diff (text/plain), 1.45 KB, created by
Harrison Grundy
on 2014-12-17 00:39:47 UTC
(
hide
)
Description:
Updated Patch to return EADDRINUSE on TIME_WAIT instead of EALREADY
Filename:
MIME Type:
Creator:
Harrison Grundy
Created:
2014-12-17 00:39:47 UTC
Size:
1.45 KB
patch
obsolete
>--- sys/netinet/tcp_usrreq.c.old 2014-12-16 12:06:56.255281206 -0800 >+++ sys/netinet/tcp_usrreq.c 2014-12-16 16:15:48.703249522 -0800 >@@ -460,8 +461,12 @@ > inp = sotoinpcb(so); > KASSERT(inp != NULL, ("tcp_usr_connect: inp == NULL")); > INP_WLOCK(inp); >- if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { >- error = EINVAL; >+ if (inp->inp_flags & (INP_TIMEWAIT)) { >+ error = EADDRINUSE; >+ goto out; >+ } >+ if (inp->inp_flags & (INP_DROPPED)) { >+ error = ECONNREFUSED; > goto out; > } > tp = intotcpcb(inp); >@@ -507,8 +512,12 @@ > inp = sotoinpcb(so); > KASSERT(inp != NULL, ("tcp6_usr_connect: inp == NULL")); > INP_WLOCK(inp); >- if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { >- error = EINVAL; >+ if (inp->inp_flags & (INP_TIMEWAIT)) { >+ error = EADDRINUSE; >+ goto out; >+ } >+ if (inp->inp_flags & (INP_DROPPED)) { >+ error = ECONNREFUSED; > goto out; > } > tp = intotcpcb(inp); >@@ -730,7 +739,7 @@ > KASSERT(inp != NULL, ("inp == NULL")); > INP_WLOCK(inp); > if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { >- error = ECONNRESET; >+ error = ENOTCONN; > goto out; > } > tp = intotcpcb(inp); >@@ -763,7 +772,7 @@ > KASSERT(inp != NULL, ("tcp_usr_rcvd: inp == NULL")); > INP_WLOCK(inp); > if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { >- error = ECONNRESET; >+ error = ENOTCONN; > goto out; > } > tp = intotcpcb(inp); >@@ -814,7 +823,7 @@ > m_freem(control); > if (m) > m_freem(m); >- error = ECONNRESET; >+ error = ENOTCONN; > goto out; > } > #ifdef INET6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 196035
:
150652
|
150658
| 150662