diff options
author | peter <peter@FreeBSD.org> | 2000-05-19 00:55:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2000-05-19 00:55:21 +0000 |
commit | e7bffe5da66db34ea10a66d32b56f61548d15af4 (patch) | |
tree | f76eec59752df734fb5371b4d8605e77c1a327e6 /sys/netinet/in_pcb.c | |
parent | 7c263c5bb0d4c3a35cd67dc436ca4f4d263896dc (diff) | |
download | FreeBSD-src-e7bffe5da66db34ea10a66d32b56f61548d15af4.zip FreeBSD-src-e7bffe5da66db34ea10a66d32b56f61548d15af4.tar.gz |
Return ECONNRESET instead of EINVAL if the connection has been shot
down as a result of a reset. Returning EINVAL in that case makes no
sense at all and just confuses people as to what happened. It could be
argued that we should save the original address somewhere so that
getsockname() etc can tell us what it used to be so we know where the
problem connection attempts are coming from.
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r-- | sys/netinet/in_pcb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index 80bbe05..6d7b23a 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -582,7 +582,7 @@ in_setsockaddr(so, nam) if (!inp) { splx(s); free(sin, M_SONAME); - return EINVAL; + return ECONNRESET; } sin->sin_port = inp->inp_lport; sin->sin_addr = inp->inp_laddr; @@ -605,7 +605,7 @@ in_setpeeraddr(so, nam) * Do the malloc first in case it blocks. */ MALLOC(sin, struct sockaddr_in *, sizeof *sin, M_SONAME, M_WAITOK); - bzero((caddr_t)sin, sizeof (*sin)); + bzero(sin, sizeof (*sin)); sin->sin_family = AF_INET; sin->sin_len = sizeof(*sin); @@ -614,7 +614,7 @@ in_setpeeraddr(so, nam) if (!inp) { splx(s); free(sin, M_SONAME); - return EINVAL; + return ECONNRESET; } sin->sin_port = inp->inp_fport; sin->sin_addr = inp->inp_faddr; |