From: Matthew Newton Date: Wed, 21 Mar 2018 14:20:34 +0000 (-0500) Subject: Microseconds part can be 0 to 999999 so 32bits is fine X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=edb197a13526bc1cdf40a787639a53b7e2b19598;p=thirdparty%2Ffreeradius-server.git Microseconds part can be 0 to 999999 so 32bits is fine --- diff --git a/src/main/xlat_eval.c b/src/main/xlat_eval.c index 157161089e4..a0f6f834028 100644 --- a/src/main/xlat_eval.c +++ b/src/main/xlat_eval.c @@ -240,14 +240,14 @@ static xlat_action_t xlat_eval_one_letter(TALLOC_CTX *ctx, fr_cursor_t *out, REQ } break; - case 'C': /* Current epoch time microseconds */ + case 'C': /* Current epoch time microsecond component */ { struct timeval now; gettimeofday(&now, NULL); - MEM(value = fr_value_box_alloc(ctx, FR_TYPE_UINT64, NULL, false)); - value->datum.uint64 = (uint64_t)now.tv_usec; + MEM(value = fr_value_box_alloc(ctx, FR_TYPE_UINT32, NULL, false)); + value->datum.uint32 = (uint64_t)now.tv_usec; } break; @@ -308,9 +308,9 @@ static xlat_action_t xlat_eval_one_letter(TALLOC_CTX *ctx, fr_cursor_t *out, REQ value->datum.uint8 = ts.tm_mon + 1; break; - case 'M': /* Request microsecond */ - MEM(value = fr_value_box_alloc(ctx, FR_TYPE_UINT64, NULL, false)); - value->datum.uint64 = request->packet->timestamp.tv_usec; + case 'M': /* Request time microsecond component */ + MEM(value = fr_value_box_alloc(ctx, FR_TYPE_UINT32, NULL, false)); + value->datum.uint32 = request->packet->timestamp.tv_usec; break; case 'S': /* Request timestamp in SQL format */