]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Microseconds part can be 0 to 999999 so 32bits is fine
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 21 Mar 2018 14:20:34 +0000 (09:20 -0500)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Wed, 21 Mar 2018 14:21:31 +0000 (14:21 +0000)
src/main/xlat_eval.c

index 157161089e42b8b6a9bd320c536be64a44634a2b..a0f6f83402852f2d5c6058e5e39b1eda54513bf7 100644 (file)
@@ -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 */