lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 19 May 2020 11:08:35 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Roman Mashak <mrv@...atatu.com>
Cc:     David Ahern <dsahern@...il.com>, netdev@...r.kernel.org,
        kernel@...atatu.com, jhs@...atatu.com, xiyou.wangcong@...il.com,
        jiri@...nulli.us
Subject: Re: [PATCH iproute2-next 1/1] tc: report time an action was first
 used

On Mon, 18 May 2020 12:41:10 -0400
Roman Mashak <mrv@...atatu.com> wrote:

> David Ahern <dsahern@...il.com> writes:
> 
> > On 5/17/20 7:28 AM, Roman Mashak wrote:  
> >> Have print_tm() dump firstuse value along with install, lastuse
> >> and expires.
> >> 
> >> Signed-off-by: Roman Mashak <mrv@...atatu.com>
> >> ---
> >>  tc/tc_util.c | 5 +++++
> >>  1 file changed, 5 insertions(+)
> >> 
> >> diff --git a/tc/tc_util.c b/tc/tc_util.c
> >> index 12f865cc71bf..f6aa2ed552a9 100644
> >> --- a/tc/tc_util.c
> >> +++ b/tc/tc_util.c
> >> @@ -760,6 +760,11 @@ void print_tm(FILE *f, const struct tcf_t *tm)
> >>  		print_uint(PRINT_FP, NULL, " used %u sec",
> >>  			   (unsigned int)(tm->lastuse/hz));
> >>  	}
> >> +	if (tm->firstuse != 0) {
> >> +		print_uint(PRINT_JSON, "first_used", NULL, tm->firstuse);
> >> +		print_uint(PRINT_FP, NULL, " firstused %u sec",
> >> +			   (unsigned int)(tm->firstuse/hz));
> >> +	}
> >>  	if (tm->expires != 0) {
> >>  		print_uint(PRINT_JSON, "expires", NULL, tm->expires);
> >>  		print_uint(PRINT_FP, NULL, " expires %u sec",
> >>   
> >
> > why does this function print different values for json and stdout?  
> 
> It prints times in jiffies for json mode, and in seconds otherwise. This
> inconsistency is likely a bug, and a subject for another fix.
> 
> Last time this function was touched in commit
> 2704bd62558391c00bc1c3e7f8706de8332d8ba0 where json was added.

iproute commands are not supposed to expose the jiffies version of
times in input or output. 

Powered by blists - more mailing lists