diff options
author | Koop Mast <kwm@FreeBSD.org> | 2015-03-02 10:50:14 +0000 |
---|---|---|
committer | Koop Mast <kwm@FreeBSD.org> | 2015-03-02 10:50:14 +0000 |
commit | b83c7a43eb0cbd22fb3dac3c269e9ee23012c15e (patch) | |
tree | 9f7714a15ea38ee94d4f4fa8cc7570a89a2f52d5 /net/mrouted | |
parent | fb498c13165955f95b112ff023a25cc155b370d0 (diff) | |
download | ports-b83c7a43eb0cbd22fb3dac3c269e9ee23012c15e.tar.gz ports-b83c7a43eb0cbd22fb3dac3c269e9ee23012c15e.zip |
Notes
Diffstat (limited to 'net/mrouted')
-rw-r--r-- | net/mrouted/files/patch-mtrace.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/net/mrouted/files/patch-mtrace.c b/net/mrouted/files/patch-mtrace.c new file mode 100644 index 000000000000..44d503e02dde --- /dev/null +++ b/net/mrouted/files/patch-mtrace.c @@ -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; |