diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/net/checksum.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/net/checksum.h b/include/net/checksum.h index 7df472c2fe..05a0d273fe 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h @@ -34,6 +34,12 @@ net_checksum_add(int len, uint8_t *buf) } static inline uint16_t +net_checksum_finish_nozero(uint32_t sum) +{ + return net_checksum_finish(sum) ?: 0xFFFF; +} + +static inline uint16_t net_raw_checksum(uint8_t *data, int length) { return net_checksum_finish(net_checksum_add(length, data)); |