Menu

#154 bmac library allows to sends packets with empty payload?

open
nobody
btnut (45)
5
2007-03-22
2007-03-13
No

Instead of

(bmac_send(BROADCAST_ADDR, (u_char *) "BTWAKEUP", STRLEN("BTWAKEUP")) == 0)

I wrote mistakenly

(bmac_send(BROADCAST_ADDR, (u_char *) "BTWAKEUP", STRLEN("BTWAKEUP") == 0))

which sends an packet with empty payload.

After reviewing the code, it does not catch a payload length of zero. Please clarify if this is intentional. If so clarify/verify if the packet handler is working correctly with a payload length of zero...

Discussion

  • Mustafa Yuecel

    Mustafa Yuecel - 2007-03-13
    • summary: bmac library doesnt handles empty packets clean --> bmac library allows to sends packets with empty payload?
     
  • Matthias Ringwald

    • priority: 5 --> 3
     
  • Matthias Ringwald

    Logged In: YES
    user_id=687107
    Originator: NO

    If the user wants to send an empty packet, why not?
    It's still one bit of information. :)

    I would leave it as it is, as I don't see a reason to not send empty packets.
    I'm sure bluetooth also allows to send empty packets, btw.

     
  • Mustafa Yuecel

    Mustafa Yuecel - 2007-03-22

    Logged In: YES
    user_id=749518
    Originator: YES

    Sending empty packets is great, but only if the code will catch this special case.

    Was it tested with empty packets? While reviewing the code it seems to not catch this case (e.g. bmac_receive ignores empty packets and will wait longer, instead of returning a data_len of zero), but maybe I am wrong...

     
  • Matthias Ringwald

    Logged In: YES
    user_id=687107
    Originator: NO

    good point. receiving empty packets should work, too. :)
    I didn't write or test the code so far.

    then I'd suggest to fix the receiving part, to also receive empty packets.

     
  • Matthias Ringwald

    • priority: 3 --> 5
     
MongoDB Logo MongoDB