[riot-notifications] [RIOT-OS/RIOT] sys/shell/commands/gnrc_icmpv6_echo: test for ICMPv6 reply corruption (#15622)

Martine Lenders notifications at github.com
Wed Aug 11 11:47:03 CEST 2021


@miri64 commented on this pull request.



> +        buf += sizeof(now);
+    }
+
+    while (len--) {
+        *buf++ = i++;
+    }
+}
+
+static bool _check_payload(const void *buf, size_t len,
+                           uint32_t *triptime, uint16_t *corrupt)
+{
+    uint8_t i = 0;
+    const uint8_t *data = buf;
+
+    if (len >= sizeof(uint32_t)) {
+        *triptime = xtimer_now_usec() - unaligned_get_u32(buf);

`now` is now much later fetched. Can this be a problem? Ideally this should come directly after the receive and maybe provided as a parameter to `_check_payload()`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15622#pullrequestreview-727277209
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210811/18c2b258/attachment-0001.htm>


More information about the notifications mailing list