diff options
author | Evan Lojewski <github@meklort.com> | 2019-05-05 08:43:18 -0600 |
---|---|---|
committer | Evan Lojewski <github@meklort.com> | 2019-05-05 08:43:18 -0600 |
commit | d9b64b5efd6b91ba1149d7ca9d9af3588ff3fc44 (patch) | |
tree | 217ef455cba38229870a276281cc3c40d7b76f3a | |
parent | c6ec0ce9dcc5e1e082dd6929074648ac66d83722 (diff) | |
download | bcm5719-ortega-d9b64b5efd6b91ba1149d7ca9d9af3588ff3fc44.tar.gz bcm5719-ortega-d9b64b5efd6b91ba1149d7ca9d9af3588ff3fc44.zip |
Ignore packets of length 0.
-rw-r--r-- | libs/Network/tx.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/Network/tx.c b/libs/Network/tx.c index 081ad0a..4ab1cb6 100644 --- a/libs/Network/tx.c +++ b/libs/Network/tx.c @@ -260,6 +260,11 @@ static uint32_t inline Network_TX_initAdditionalBlock(RegTX_PORTOut_t* block, in static inline void Network_TX_transmitPacket_internal(uint8_t* packet, uint32_t length, bool big_endian) { + if(!length) + { + return; + } + uint32_t* packet_32 = (uint32_t*)packet; uint32_t consumed = 0; uint32_t blocks = Network_TX_numBlocksNeeded(length); @@ -422,12 +427,17 @@ static uint32_t inline Network_TX_initAdditionalPassthroughBlock(RegTX_PORTOut_t void Network_TX_transmitPassthroughPacket(uint32_t length) { + if(!length) + { + return; + } + int32_t tail; int32_t first = tail = Network_TX_allocateBlock(); + int32_t next_block = -1; uint32_t blocks = Network_TX_numBlocksNeeded(length); int total_blocks = blocks;; - int32_t next_block = -1; if(blocks > 1) { next_block = Network_TX_allocateBlock(); |