Skip to content

Commit

Permalink
vb_date is microseconds since the epoch, i.e. an external time, and s…
Browse files Browse the repository at this point in the history
…o SHOULD NOT HAVE OUR INTERNAL TIME SUBTRACTED FROM IT
  • Loading branch information
arr2036 committed Dec 18, 2019
1 parent 810cd5e commit 447b80a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/lib/util/value.c
Expand Up @@ -1468,7 +1468,7 @@ ssize_t fr_value_box_from_network(TALLOC_CTX *ctx,
switch (precision) {
default:
case FR_TIME_RES_SEC: /* external seconds, internal nanoseconds */
date *= 1000000000;
date *= NSEC;
break;

case FR_TIME_RES_MSEC:
Expand All @@ -1483,13 +1483,7 @@ ssize_t fr_value_box_from_network(TALLOC_CTX *ctx,
break;
}

/*
* Convert nanoseconds to struct timespec.
*/
ts.tv_sec = date / NSEC;
ts.tv_nsec = date % NSEC;

dst->vb_date = fr_time_from_timespec(&ts);
dst->vb_date = date;
}
break;

Expand Down

0 comments on commit 447b80a

Please sign in to comment.