the lifetime is a delta, and the "expires" field is a wall-clock
time.
t->mode = EAP_FAST_PROVISIONING_AUTH;
}
- if (!t->pac.expires || t->pac.expired || t->pac.expires - time(NULL) < t->pac_lifetime * 0.6)
+ /*
+ * Send a new pac at ~0.6 times the lifetime.
+ */
+ if (!t->pac.expires || t->pac.expired || t->pac.expires < (time(NULL) + (t->pac_lifetime >> 1) + (t->pac_lifetime >> 3))) {
t->pac.send = true;
}
break;
case PAC_INFO_PAC_LIFETIME:
rad_assert(t->pac.expires == 0);
- t->pac.expires = vp->vp_integer;
- t->pac.expired = (vp->vp_integer <= time(NULL));
+ t->pac.expires = vp->vp_integer + time(NULL);
+ t->pac.expired = false;
break;
case PAC_INFO_PAC_KEY:
rad_assert(t->pac.key == NULL);