   if (INET::checksum(&reply, sizeof(reply)) != 0) goto error;
 
   // Calculate the time for the ping roundtrip
-  roundtrip -= reply.timestamp;
-  INFO("Roundtrip: %ul us", roundtrip);
+  INFO("Roundtrip: %ul us", stop - reply.timestamp);
 
  error:
   sock->close();

  int res = sock->send(&req, sizeof(req), dest, 0);
  if (res < 0) goto error;

  INFO("Receive the reply", 0);
  uint32_t roundtrip;
  icmphdr reply;
  uint8_t src[4];
  uint16_t port;
  for (uint8_t retry = 0; retry < 10; retry++) {
    if ((res = sock->available()) > 0) break;
    delay(1);
  }
  if (res != sizeof(reply) + sizeof(IPRAW_HEADER)) goto error;
  res = sock->recv(&reply, sizeof(reply), src, port);
  roundtrip = RTC::micros();

  // Sanity check the reply; right size, type, id, seq nr, and checksum
  if (res != sizeof(reply)) goto error;

  Socket* sock = ethernet.socket(Socket::IPRAW, IPPROTO_ICMP);
  ASSERT(sock != NULL);

  INFO("Build ICMP echo request block", 0); trace.flush();
  icmphdr req;
  static uint16_t seq = 0;
  req.type = ICMP_ECHO;
