Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern return ECONNABORTED, if the socket (tcp connection ...



details:   https://anonhg.NetBSD.org/src/rev/e46bab6e394a
branches:  trunk
changeset: 503485:e46bab6e394a
user:      itojun <itojun%NetBSD.org@localhost>
date:      Wed Feb 07 12:20:43 2001 +0000

description:
return ECONNABORTED, if the socket (tcp connection for example)
is disconnected by RST right before accept(2).  fixes PR 10698/12027.
checked with SUSv2, XNET 5.2, and Stevens (unix network programming
vol 1 2nd ed) section 5.11.

diffstat:

 sys/kern/uipc_socket.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r ef4211a680c1 -r e46bab6e394a sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Wed Feb 07 11:56:04 2001 +0000
+++ b/sys/kern/uipc_socket.c    Wed Feb 07 12:20:43 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket.c,v 1.52 2001/01/22 18:14:11 itojun Exp $  */
+/*     $NetBSD: uipc_socket.c,v 1.53 2001/02/07 12:20:43 itojun Exp $  */
 
 /*
  * Copyright (c) 1982, 1986, 1988, 1990, 1993
@@ -271,7 +271,7 @@
                error = (*so->so_proto->pr_usrreq)(so, PRU_ACCEPT,
                    (struct mbuf *)0, nam, (struct mbuf *)0, (struct proc *)0);
        else
-               nam->m_len = 0;
+               error = ECONNABORTED;
 
        splx(s);
        return (error);



Home | Main Index | Thread Index | Old Index