Skip to content

Commit

Permalink
drivers/at86rf2xx: mask frame length according to data sheet
Browse files Browse the repository at this point in the history
After some discussion on the devel mailing list about smuggeling in corrupted frames by e.g. SDRs I'd propose we mask the length field according to the datasheet again. It was done before in at86rf2xx_get_length but this funtion did get used anymore along the way.
  • Loading branch information
thomaseichinger committed Apr 2, 2016
1 parent ceab9bd commit e5e67b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/at86rf2xx/at86rf2xx_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ static int _recv(netdev2_t *netdev, char *buf, int len, void *info)
/* get the size of the received packet */
at86rf2xx_fb_read(dev, &phr, 1);

/* Ignore FCS for packet length */
pkt_len = phr - 2;
/* ignore MSB (refer p.80) and substract length of FCS field */
pkt_len = (phr & 0x7f) - 2;

/* just return length when buf == NULL */
if (buf == NULL) {
Expand Down

0 comments on commit e5e67b3

Please sign in to comment.