Andrew Boyson / net

Dependents:   oldheating gps motorhome heating

Files at this revision

API Documentation at this revision

Comitter:
andrewboyson
Date:
Thu Dec 24 19:17:06 2020 +0000
Parent:
174:60e5ab296671
Child:
176:7eb916c22084
Commit message:
Corrected ndp uint32 decode routine

Changed in this revision

ip6/icmp/ndp/ndp.c Show annotated file Show diff for this revision Revisions of this file
--- a/ip6/icmp/ndp/ndp.c	Wed Dec 23 19:43:09 2020 +0000
+++ b/ip6/icmp/ndp/ndp.c	Thu Dec 24 19:17:06 2020 +0000
@@ -85,11 +85,10 @@
 
 static uint32_t decodeUint32(char* p)
 {
-    uint32_t value;
-    value =              *p++;
-    value = value << 8 | *p++;
-    value = value << 8 | *p++;
-    value = value << 8 | *p;
+    uint32_t     value  = *p++;
+    value <<= 8; value += *p++;
+    value <<= 8; value += *p++;
+    value <<= 8; value += *p++;
     return value;
 }
 static int decodeOption(char* p, char* srcMac, char* dstMac)