Page MenuHomeFreeBSD

D1982.id4019.diff
No OneTemporary

D1982.id4019.diff

Index: sys/netinet/tcp_usrreq.c
===================================================================
--- sys/netinet/tcp_usrreq.c
+++ sys/netinet/tcp_usrreq.c
@@ -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

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 6, 11:11 AM (10 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30963020
Default Alt Text
D1982.id4019.diff (1 KB)

Event Timeline