Skip to content

Commit

Permalink
net/mpd5: add a fix from upstream r2247
Browse files Browse the repository at this point in the history
Prevent reporting wrong traffic accounting data in very rare case
of failure of netgraph statistical socket data flow.
  • Loading branch information
eugen authored and eugen committed Jul 27, 2018
1 parent d9145dd commit 052b84f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion net/mpd5/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

PORTNAME= mpd
DISTVERSION= 5.8
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= net
MASTER_SITES= SF/${PORTNAME}/Mpd5/Mpd-${PORTVERSION}
PKGNAMESUFFIX= 5
Expand Down
30 changes: 30 additions & 0 deletions net/mpd5/files/patch-fixstats
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Index: src/bund.c
===================================================================
--- src/bund.c (revision 2246)
+++ src/bund.c (revision 2247)
@@ -1394,9 +1394,9 @@ BundUpdateStats(Bund b)
b->stats.runts += abs(stats.runts - b->oldStats.runts);
b->stats.dupFragments += abs(stats.dupFragments - b->oldStats.dupFragments);
b->stats.dropFragments += abs(stats.dropFragments - b->oldStats.dropFragments);
+ b->oldStats = stats;
}

- b->oldStats = stats;
#else
NgFuncGetStats64(b, l, &b->stats);
#endif
Index: src/link.c
===================================================================
--- src/link.c (revision 2246)
+++ src/link.c (revision 2247)
@@ -1359,9 +1359,9 @@ LinkUpdateStats(Link l)
l->stats.runts += abs(stats.runts - l->oldStats.runts);
l->stats.dupFragments += abs(stats.dupFragments - l->oldStats.dupFragments);
l->stats.dropFragments += abs(stats.dropFragments - l->oldStats.dropFragments);
+ l->oldStats = stats;
}

- l->oldStats = stats;
#else
NgFuncGetStats64(l->bund, l->bundleIndex, &l->stats);
#endif

0 comments on commit 052b84f

Please sign in to comment.