Fixed checksum initialization.
FossilOrigin-Name: 14e5946aea923ce6805d678c6d39750b02956201f75b49704138ff5f7b7cbe6c
This commit is contained in:
parent
97696c7b36
commit
726b40d1a7
@ -19,13 +19,13 @@
|
|||||||
#include "lwapp.h"
|
#include "lwapp.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculate the 16-bit checksum for LWAPP image data message
|
* Calculate the 16-bit checksum for LWAPP image data message
|
||||||
* elements with opcode 3 - used by Cisco also in CAPWAP
|
* elements with opcode 3 - used by Cisco also in CAPWAP
|
||||||
*/
|
*/
|
||||||
uint16_t lw_checksum(uint8_t * d, int len)
|
uint16_t lw_checksum(uint8_t * d, int len)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
uint32_t cs = 0;
|
uint32_t cs = 0xffff;
|
||||||
for (i = 0; i < len; i += 2) {
|
for (i = 0; i < len; i += 2) {
|
||||||
uint16_t w = d[i] << 8;
|
uint16_t w = d[i] << 8;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user