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

FW: [bluetooth-dev] another rfcomm.c bug?



Aaaah,

Forget about the pointerstuff, data is a u8 * so it will work, need more coffee :) 

Best Regards
Anders Johansson

> -----Original Message-----
> From: Anders Torbjörn Johansson 
> Sent: Tuesday, October 16, 2001 11:16 AM
> To: bluetooth-dev@xxxxxxx.com
> Subject: RE: [bluetooth-dev] another rfcomm.c bug?
> 
> 
> Hi,
> 
> Yes you are right, I also found another bug with the PN-msg. 
> As you can see we intend to forward the pointer one byte by 
> doing data++, but wat really happends is that we forward it 
> with the size of that struct, a better way to do it is to write:
> 
> ((u8 *)data)++;
> 
> I'll check in the updates at sourceforge shortly.
> 
> Thanks a lot!
> 
> Best Regards
> Anders Johansson
> 
> > -----Original Message-----
> > From: Will Lentz [mailto:Will_Lentz@xxxxxxx.COM]
> > Sent: Monday, October 15, 2001 10:18 PM
> > To: bluetooth-dev@xxxxxxx.com
> > Subject: [bluetooth-dev] another rfcomm.c bug?
> > 
> > 
> > Shouldn't the pn_msg be swapped after the pointer
> > to pn_pkt is fully set up?  (see the patch below)
> > 
> > Thanks,
> > Will
> > 
> > Index: rfcomm.c
> > ===================================================================
> > RCS file: /cvsroot/openbt/linux/drivers/char/bluetooth/rfcomm.c,v
> > retrieving revision 1.124
> > diff -a -u -d -r1.124 rfcomm.c
> > --- rfcomm.c    2001/10/12 12:03:22     1.124
> > +++ rfcomm.c    2001/10/15 20:13:10
> > @@ -1571,7 +1571,6 @@
> >         case PN:  /*DLC parameter negotiation*/
> >         {
> >                 pn_msg *pn_pkt = (pn_msg*) data;
> > -               swap_pn_msg(pn_pkt);
> >                 D_CTRL(FNC"Received DLC parameter 
> negotiation, PN\n");
> >                 if (longpkt) {
> >                         /* If a long length field is used, 
> > then move the
> > @@ -1579,6 +1578,7 @@
> >                         data++;
> >                         pn_pkt = (pn_msg*) data;
> >                 }  
> > +               swap_pn_msg(pn_pkt);
> >                 if (pn_pkt->mcc_s_head.type.cr == MCC_CMD) {
> >                         u8 tmp_dlci;
> >                         u16 frame_size;
> > -
> > To unsubscribe from this list: send the line "unsubscribe 
> > bluetooth-dev" in
> > the body of a message to majordomo@xxxxxxx.com
> > 
> 
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com