Bug 188520 - [patch] ifconfig(8): ifconfig -L shows pltime and vltime as zero since 10.0-RELEASE
Summary: [patch] ifconfig(8): ifconfig -L shows pltime and vltime as zero since 10.0-R...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hajimu UMEMOTO
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-12 16:50 UTC by guyyur
Modified: 2014-07-07 15:35 UTC (History)
1 user (show)

See Also:


Attachments
ifconfig_af_inet6_monotonic.patch (2.32 KB, patch)
2014-04-12 16:50 UTC, guyyur
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description guyyur 2014-04-12 16:50:00 UTC
ifconfig -L shows pltime and vltime as zero.

Seems that ifconfig was missed in r253970 which
changed usage from time_second to time_uptime.


ifconfig -L
...
        inet6 XXXX:XXXX:XXXX:XXXX:YYYY:YYYY:YYYY:YYYY
          prefixlen 64 autoconf temporary pltime 0 vltime 0

The prefix is learned via router advertisment.
tcpdump shows non zero values in the icmp6 packet.

A test program that calls SIOCGIFALIFETIME_IN6
shows the value is < wall clock which is
the test done by ifconfig.
time = 1397314436
ia6t_preferred = 608907
ia6t_expire = 2596107

Fix: Attached patch to use clock_gettime(CLOCK_MONOTONIC_FAST)
in ifconfig per r253970 comment.


How-To-Repeat: Run "ifconfig -L" with global or ULA IPv6 addresses learned
through router advertisment or define an IPv6 address
with pltime and vltime:
ifconfig IFNAME inet6 2001:DB8::1 pltime 100 vltime 100
ifconfig -L IFNAME inet6
Comment 1 commit-hook freebsd_committer freebsd_triage 2014-06-30 16:40:19 UTC
A commit references this bug:

Author: ume
Date: Mon Jun 30 16:39:37 UTC 2014
New revision: 268049
URL: http://svnweb.freebsd.org/changeset/base/268049

Log:
  Fix ifconfig to show pltime and vltime with -L option,
  again after usage change from time_second to time_uptime.

  PR:		188520
  Submitted by:	Guy Yur <guyyur__at__gmail.com>
  MFC after:	1 week

Changes:
  head/sbin/ifconfig/af_inet6.c
Comment 2 Hajimu UMEMOTO freebsd_committer freebsd_triage 2014-06-30 16:43:59 UTC
Thank you for the patch.
I've committed it.
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-07-07 15:32:01 UTC
A commit references this bug:

Author: ume
Date: Mon Jul  7 15:31:47 UTC 2014
New revision: 268367
URL: http://svnweb.freebsd.org/changeset/base/268367

Log:
  MFC r268049:
  Fix ifconfig to show pltime and vltime with -L option,
  again after usage change from time_second to time_uptime.

  PR:		188520
  Submitted by:	Guy Yur <guyyur__at__gmail.com>

Changes:
_U  stable/10/
  stable/10/sbin/ifconfig/af_inet6.c
Comment 4 Hajimu UMEMOTO freebsd_committer freebsd_triage 2014-07-07 15:35:20 UTC
MFC'ed into stable/10.
Thank you!