svn commit: r380247 - head/net/mrouted/files

Koop Mast kwm at FreeBSD.org
Mon Mar 2 10:50:15 UTC 2015


Author: kwm
Date: Mon Mar  2 10:50:14 2015
New Revision: 380247
URL: https://svnweb.freebsd.org/changeset/ports/380247
QAT: https://qat.redports.org/buildarchive/r380247/

Log:
  Fix the build with clang 3.5.
  
  PR:		196166
  Submitted by:	dim@
  Approved by:	maintainer (timeout 6 weeks)

Added:
  head/net/mrouted/files/patch-mtrace.c   (contents, props changed)

Added: head/net/mrouted/files/patch-mtrace.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/mrouted/files/patch-mtrace.c	Mon Mar  2 10:50:14 2015	(r380247)
@@ -0,0 +1,24 @@
+--- mtrace.c.orig	2011-10-23 10:03:36.000000000 +0200
++++ mtrace.c	2014-12-20 20:31:14.000000000 +0100
+@@ -903,6 +903,12 @@ void stat_line(struct tr_resp *r, struct
+     }
+ }
+ 
++static uint32_t
++udiff(uint32_t u, uint32_t v)
++{
++	return (u >= v ? u - v : v - u);
++}
++
+ /*
+  * A fixup to check if any pktcnt has been reset, and to fix the
+  * byteorder bugs in mrouted 3.6 on little-endian machines.
+@@ -920,7 +926,7 @@ void fixup_stats(struct resp_buf *base, 
+     /* Check for byte-swappers */
+     while (--rno >= 0) {
+ 	--n; --p; --b; --s;
+-	if (*s || abs(ntohl(n->tr_vifout) - ntohl(p->tr_vifout)) > 100000) {
++	if (*s || udiff(ntohl(n->tr_vifout), ntohl(p->tr_vifout)) > 100000) {
+ 	    /* This host sends byteswapped reports; swap 'em */
+ 	    if (!*s) {
+ 		*s = 1;


More information about the svn-ports-head mailing list