Source-Changes-HG archive

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

[src/trunk]: src/sys/netbt fix reversed logic for Remote Port Negotiation, po...



details:   https://anonhg.NetBSD.org/src/rev/758526c0cc6d
branches:  trunk
changeset: 1007626:758526c0cc6d
user:      plunky <plunky%NetBSD.org@localhost>
date:      Sun Feb 23 20:16:10 2020 +0000

description:
fix reversed logic for Remote Port Negotiation, pointed out by maxv@

diffstat:

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

diffs (34 lines):

diff -r 3d189887ad1a -r 758526c0cc6d sys/netbt/rfcomm_session.c
--- a/sys/netbt/rfcomm_session.c        Sun Feb 23 20:08:35 2020 +0000
+++ b/sys/netbt/rfcomm_session.c        Sun Feb 23 20:16:10 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rfcomm_session.c,v 1.25 2018/12/22 14:28:57 maxv Exp $ */
+/*     $NetBSD: rfcomm_session.c,v 1.26 2020/02/23 20:16:10 plunky Exp $       */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.25 2018/12/22 14:28:57 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rfcomm_session.c,v 1.26 2020/02/23 20:16:10 plunky Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -1232,11 +1232,13 @@
        rpn.xoff_char = RFCOMM_RPN_XOFF_CHAR;
 
        if (m->m_pkthdr.len == sizeof(rpn)) {
+               /* negotiation request */
                m_copydata(m, 0, sizeof(rpn), &rpn);
-               rpn.param_mask = RFCOMM_RPN_PM_ALL;
+               rpn.param_mask = le16toh(rpn.param_mask);
        } else if (m->m_pkthdr.len == 1) {
+               /* current settings request */
                m_copydata(m, 0, 1, &rpn);
-               rpn.param_mask = le16toh(rpn.param_mask);
+               rpn.param_mask = RFCOMM_RPN_PM_ALL;
        } else {
                DPRINTF("Bad RPN length (%d)\n", m->m_pkthdr.len);
                return;



Home | Main Index | Thread Index | Old Index