Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netbt do not produce an error when connections are close...
details: https://anonhg.NetBSD.org/src/rev/fead1e36c7a7
branches: trunk
changeset: 758846:fead1e36c7a7
user: plunky <plunky%NetBSD.org@localhost>
date: Wed Nov 17 20:19:25 2010 +0000
description:
do not produce an error when connections are closed normally
for L2CAP sockets, this solves an irritating error message from sdpd(8),
which can now differentiate between normal closure and error.
diffstat:
sys/netbt/l2cap_signal.c | 6 +++---
sys/netbt/rfcomm_session.c | 13 ++++++++++---
2 files changed, 13 insertions(+), 6 deletions(-)
diffs (68 lines):
diff -r c12e63108279 -r fead1e36c7a7 sys/netbt/l2cap_signal.c
--- a/sys/netbt/l2cap_signal.c Wed Nov 17 20:07:50 2010 +0000
+++ b/sys/netbt/l2cap_signal.c Wed Nov 17 20:19:25 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: l2cap_signal.c,v 1.10 2009/09/25 19:44:57 plunky Exp $ */
+/* $NetBSD: l2cap_signal.c,v 1.11 2010/11/17 20:19:25 plunky Exp $ */
/*-
* Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: l2cap_signal.c,v 1.10 2009/09/25 19:44:57 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: l2cap_signal.c,v 1.11 2010/11/17 20:19:25 plunky Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -814,7 +814,7 @@
sizeof(rp), &rp);
if (chan->lc_state != L2CAP_CLOSED)
- l2cap_close(chan, ECONNRESET);
+ l2cap_close(chan, 0);
}
/*
diff -r c12e63108279 -r fead1e36c7a7 sys/netbt/rfcomm_session.c
--- a/sys/netbt/rfcomm_session.c Wed Nov 17 20:07:50 2010 +0000
+++ b/sys/netbt/rfcomm_session.c Wed Nov 17 20:19:25 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rfcomm_session.c,v 1.16 2010/01/03 16:38:15 plunky Exp $ */
+/* $NetBSD: rfcomm_session.c,v 1.17 2010/11/17 20:19:25 plunky Exp $ */
/*-
* Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.16 2010/01/03 16:38:15 plunky Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.17 2010/11/17 20:19:25 plunky Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -389,6 +389,13 @@
DPRINTF("Disconnected\n");
+ /*
+ * If we have any DLCs outstanding in the unlikely case that the
+ * L2CAP channel disconnected normally, close them with an error
+ */
+ if (err == 0)
+ err = ECONNRESET;
+
rs->rs_state = RFCOMM_SESSION_CLOSED;
while (!LIST_EMPTY(&rs->rs_dlcs)) {
@@ -816,7 +823,7 @@
return;
}
- rfcomm_dlc_close(dlc, ECONNRESET);
+ rfcomm_dlc_close(dlc, 0);
rfcomm_session_send_frame(rs, RFCOMM_FRAME_UA, dlci);
}
Home |
Main Index |
Thread Index |
Old Index