ng_netdev_eth: default to NG_ETHERTYPE_UNKNOWN when no payload avail.
This commit is contained in:
parent
9a063b9225
commit
4bda0f6f54
@ -373,7 +373,12 @@ static int _marshall_ethernet(ng_netdev_eth_t *dev, uint8_t *buffer, ng_pktsnip_
|
|||||||
return -EBADMSG;
|
return -EBADMSG;
|
||||||
}
|
}
|
||||||
|
|
||||||
hdr->type = byteorder_htons(ng_nettype_to_ethertype(pkt->next->type));
|
if (payload) {
|
||||||
|
hdr->type = byteorder_htons(ng_nettype_to_ethertype(payload->type));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hdr->type = byteorder_htons(NG_ETHERTYPE_UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
netif_hdr = pkt->data;
|
netif_hdr = pkt->data;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user