[PATCH] timing in arping (wrt Re: screwy timing in arping (v1.7.2 avr32))

Tommi Kyntola tommi.kyntola at ray.fi
Tue Dec 18 02:04:37 PST 2007


This patch addresses the time printout in arping.

Signed-off-by: Tommi Kyntola <tommi.kyntola at ray.fi>
---
diff -Naur busybox-1.8.2-vanilla/networking/arping.c busybox-1.8.2-arpingfix/networking/arping.c
--- busybox-1.8.2-vanilla/networking/arping.c   2007-11-10 03:40:47.000000000 +0200
+++ busybox-1.8.2-arpingfix/networking/arping.c 2007-12-18 11:44:18.000000000 +0200
@@ -133,6 +133,10 @@
  	unsigned char *p = (unsigned char *) (ah + 1);
  	struct in_addr src_ip, dst_ip;

+	unsigned now;
+
+	now = MONOTONIC_US();
+
  	/* Filter out wild packets */
  	if (FROM->sll_pkttype != PACKET_HOST
  	 && FROM->sll_pkttype != PACKET_BROADCAST
@@ -207,7 +211,7 @@
  		}

  		if (last) {
-			printf(" %u.%03ums\n", last / 1000, last % 1000);
+			printf(" %u.%03ums\n", (now-last) / 1000, (now-last) % 1000);
  		} else {
  			printf(" UNSOLICITED?\n");
  		}


More information about the busybox mailing list