Source-Changes-HG archive

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

[src/trunk]: src/sys/netbt when receiving a MCC PN response, the max frame si...



details:   https://anonhg.NetBSD.org/src/rev/b80cc5d200c9
branches:  trunk
changeset: 750504:b80cc5d200c9
user:      plunky <plunky%NetBSD.org@localhost>
date:      Sun Jan 03 16:38:15 2010 +0000

description:
when receiving a MCC PN response, the max frame size that the remote
party requests must be less than the one we asked for which will not
be greater than the max acceptable value so no need to test for that
but make sure that it is not smaller than minimum acceptable value.

diffstat:

 sys/netbt/rfcomm_session.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r d178fbdfb80d -r b80cc5d200c9 sys/netbt/rfcomm_session.c
--- a/sys/netbt/rfcomm_session.c        Sun Jan 03 12:53:00 2010 +0000
+++ b/sys/netbt/rfcomm_session.c        Sun Jan 03 16:38:15 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rfcomm_session.c,v 1.15 2009/09/13 18:45:11 pooka Exp $        */
+/*     $NetBSD: rfcomm_session.c,v 1.16 2010/01/03 16:38:15 plunky Exp $       */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.15 2009/09/13 18:45:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.16 2010/01/03 16:38:15 plunky Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -1372,7 +1372,8 @@
 
                callout_stop(&dlc->rd_timeout);
 
-               if (pn.mtu > RFCOMM_MTU_MAX || pn.mtu > dlc->rd_mtu) {
+               /* reject invalid or unacceptable MTU */
+               if (pn.mtu < RFCOMM_MTU_MIN || pn.mtu > dlc->rd_mtu) {
                        dlc->rd_state = RFCOMM_DLC_WAIT_DISCONNECT;
                        err = rfcomm_session_send_frame(rs, RFCOMM_FRAME_DISC,
                                                        pn.dlci);



Home | Main Index | Thread Index | Old Index