Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/kern Pull up revision 1.52 (requested by itojun):
details: https://anonhg.NetBSD.org/src/rev/401df4622160
branches: netbsd-1-5
changeset: 490582:401df4622160
user: he <he%NetBSD.org@localhost>
date: Sat Feb 03 18:41:57 2001 +0000
description:
Pull up revision 1.52 (requested by itojun):
Prevent bogus data from being returned from the kernel on accept(2)
in case the peer already have disconnected. Partial fix for
PR#12027 and PR#10698.
diffstat:
sys/kern/uipc_socket.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 7d6d54a6e39f -r 401df4622160 sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c Sat Feb 03 18:35:14 2001 +0000
+++ b/sys/kern/uipc_socket.c Sat Feb 03 18:41:57 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_socket.c,v 1.50.4.1 2000/12/15 00:08:53 he Exp $ */
+/* $NetBSD: uipc_socket.c,v 1.50.4.2 2001/02/03 18:41:57 he Exp $ */
/*
* Copyright (c) 1982, 1986, 1988, 1990, 1993
@@ -262,7 +262,7 @@
struct mbuf *nam;
{
int s = splsoftnet();
- int error;
+ int error = 0;
if ((so->so_state & SS_NOFDREF) == 0)
panic("soaccept: !NOFDREF");
@@ -271,7 +271,8 @@
error = (*so->so_proto->pr_usrreq)(so, PRU_ACCEPT,
(struct mbuf *)0, nam, (struct mbuf *)0, (struct proc *)0);
else
- error = 0;
+ nam->m_len = 0;
+
splx(s);
return (error);
}
Home |
Main Index |
Thread Index |
Old Index