Bug 240947 - Hours calculation in blacklistctl dump output incorrect
Summary: Hours calculation in blacklistctl dump output incorrect
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.3-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Ed Maste
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-30 19:05 UTC by Paul van der Zwan
Modified: 2020-08-01 15:15 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul van der Zwan 2019-09-30 19:05:22 UTC
When remaining time for blacklist entry > 24h the hours shown is incorrect :

                         218.249.24.98/32:25	OK	1/1	2d52h21m44s
                         45.136.108.29/32:587	OK	1/1	1d28h23m49s
                        106.53.185.230/32:25	OK	1/1	1d34h6m15s

The following patch fixes the error:
$ svn diff contrib/blacklist/bin/support.c
Index: contrib/blacklist/bin/support.c
===================================================================
--- contrib/blacklist/bin/support.c	(revision 352893)
+++ contrib/blacklist/bin/support.c	(working copy)
@@ -107,7 +107,7 @@
 	t /= 60;
 	m = t % 60;
 	t /= 60;
-	h = t % 60;
+	h = t % 24;
 	t /= 24;
 	d = t % 24;
 	t /= 356;
Comment 1 Gordon Bergling freebsd_committer freebsd_triage 2020-01-07 09:16:24 UTC
This is already fixed in HEAD by rS354399. MFC should be around around the beginning of February.
Comment 2 Gordon Bergling freebsd_committer freebsd_triage 2020-01-07 09:19:35 UTC
This is already fixed in HEAD by rS354399. MFC should be around the beginning of February.
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2020-01-07 18:21:06 UTC
Assign to emaste assuming he'll do the MFC.
Comment 4 Gordon Bergling freebsd_committer freebsd_triage 2020-08-01 15:15:48 UTC
Closed by r357581 (MFC to 12-STABLE).