core/net/mac/frame802154: Fix typo in PAN ID compression condition

This commit is contained in:
Joakim Nohlgård 2016-06-13 15:40:56 +02:00
parent 4fd8f67053
commit 6f8306a465

View file

@ -146,31 +146,19 @@ frame802154_has_panid(frame802154_fcf_t *fcf, int *has_src_pan_id, int *has_dest
} }
if(fcf->frame_version == FRAME802154_IEEE802154E_2012) { if(fcf->frame_version == FRAME802154_IEEE802154E_2012) {
/* IEEE 802.15.4e-2012, Table 2a, PAN ID Compression */
if(!fcf->panid_compression) { if(!fcf->panid_compression) {
/* Compressed PAN ID == no PAN ID at all */ if(fcf->dest_addr_mode) {
if(fcf->dest_addr_mode == fcf->dest_addr_mode) { /* Use destination PAN ID if destination address is present */
/* No address or both addresses: include destination PAN ID */
dest_pan_id = 1;
} else if(fcf->dest_addr_mode) {
/* Only dest address, include dest PAN ID */
dest_pan_id = 1; dest_pan_id = 1;
} else if(fcf->src_addr_mode) { } else if(fcf->src_addr_mode) {
/* Only src address, include src PAN ID */ /* Only src address, include src PAN ID */
src_pan_id = 1; src_pan_id = 1;
} }
} } else if((fcf->dest_addr_mode == 0) && (fcf->src_addr_mode == 0)) {
if(fcf->dest_addr_mode == 0 && fcf->dest_addr_mode == 1) { /* No address included: PAN ID compression flag changes meaning */
/* No address included, include dest PAN ID conditionally */
if(!fcf->panid_compression) {
dest_pan_id = 1; dest_pan_id = 1;
} }
}
/* Remove the following rule the day rows 2 and 3 from table 2a are fixed: */
if(fcf->dest_addr_mode == 0 && fcf->dest_addr_mode == 0) {
/* Not meaningful, we include a PAN ID iff the compress flag is set, but
* this is what the standard currently stipulates */
dest_pan_id = fcf->panid_compression;
}
} else { } else {
/* No PAN ID in ACK */ /* No PAN ID in ACK */
if(fcf->frame_type != FRAME802154_ACKFRAME) { if(fcf->frame_type != FRAME802154_ACKFRAME) {