Merge pull request #11023 from miri64/gnrc_netif_ieee802154/enh/propagate-pend-frames

gnrc_netif_ieee802154: propagate pend. frame flag to stack
This commit is contained in:
Koen Zandberg 2019-03-15 12:51:50 +01:00 committed by GitHub
commit ccc09d9ed4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,7 @@ gnrc_netif_t *gnrc_netif_ieee802154_create(char *stack, int stacksize,
static gnrc_pktsnip_t *_make_netif_hdr(uint8_t *mhr)
{
gnrc_netif_hdr_t *hdr;
gnrc_pktsnip_t *snip;
uint8_t src[IEEE802154_LONG_ADDRESS_LEN], dst[IEEE802154_LONG_ADDRESS_LEN];
int src_len, dst_len;
@ -65,11 +66,15 @@ static gnrc_pktsnip_t *_make_netif_hdr(uint8_t *mhr)
DEBUG("_make_netif_hdr: no space left in packet buffer\n");
return NULL;
}
hdr = snip->data;
/* set broadcast flag for broadcast destination */
if ((dst_len == 2) && (dst[0] == 0xff) && (dst[1] == 0xff)) {
gnrc_netif_hdr_t *hdr = snip->data;
hdr->flags |= GNRC_NETIF_HDR_FLAGS_BROADCAST;
}
/* set flags for pending frames */
if (mhr[0] & IEEE802154_FCF_FRAME_PEND) {
hdr->flags |= GNRC_NETIF_HDR_FLAGS_MORE_DATA;
}
return snip;
}