pull diff from r1.62 to r1.63 from head
[freeradius.git] / src / main / valuepair.c
index 8260bcb..a34056b 100644 (file)
@@ -594,11 +594,6 @@ static int presufcmp(void *instance,
 
 /*
  *     Compare the current time to a range.
- *     Hmm... it would save work, and probably be better,
- *     if we were passed the REQUEST data structure, so we
- *     could use it's 'timestamp' element.  That way, we could
- *     do the comparison against when the packet came in, not now,
- *     and have one less system call to do.
  */
 static int timecmp(void *instance,
                   REQUEST *req UNUSED,
@@ -610,7 +605,8 @@ static int timecmp(void *instance,
        check_pairs = check_pairs;
        reply_pairs = reply_pairs;
 
-       if (timestr_match((char *)check->strvalue, time(NULL)) >= 0) {
+       if (timestr_match((char *)check->strvalue,
+                         req ? req->timestamp : time(NULL)) >= 0) {
                return 0;
        }
        return -1;