View | Details | Raw Unified | Return to bug 196166
Collapse All | Expand All

(-)net/mrouted/files/patch-mtrace.c (+24 lines)
Line 0 Link Here
1
--- mtrace.c.orig	2011-10-23 10:03:36.000000000 +0200
2
+++ mtrace.c	2014-12-20 20:31:14.000000000 +0100
3
@@ -903,6 +903,12 @@ void stat_line(struct tr_resp *r, struct
4
     }
5
 }
6
 
7
+static uint32_t
8
+udiff(uint32_t u, uint32_t v)
9
+{
10
+	return (u >= v ? u - v : v - u);
11
+}
12
+
13
 /*
14
  * A fixup to check if any pktcnt has been reset, and to fix the
15
  * byteorder bugs in mrouted 3.6 on little-endian machines.
16
@@ -920,7 +926,7 @@ void fixup_stats(struct resp_buf *base, 
17
     /* Check for byte-swappers */
18
     while (--rno >= 0) {
19
 	--n; --p; --b; --s;
20
-	if (*s || abs(ntohl(n->tr_vifout) - ntohl(p->tr_vifout)) > 100000) {
21
+	if (*s || udiff(ntohl(n->tr_vifout), ntohl(p->tr_vifout)) > 100000) {
22
 	    /* This host sends byteswapped reports; swap 'em */
23
 	    if (!*s) {
24
 		*s = 1;

Return to bug 196166