Commit e94decde authored by David S. Miller's avatar David S. Miller

[XFRM]: Handle use_time expiration properly.

parent 290fdc70
...@@ -112,9 +112,9 @@ static void xfrm_timer_handler(unsigned long data) ...@@ -112,9 +112,9 @@ static void xfrm_timer_handler(unsigned long data)
if (tmo < next) if (tmo < next)
next = tmo; next = tmo;
} }
if (x->lft.hard_use_expires_seconds && x->curlft.use_time) { if (x->lft.hard_use_expires_seconds) {
long tmo = x->lft.hard_use_expires_seconds + long tmo = x->lft.hard_use_expires_seconds +
x->curlft.use_time - now; (x->curlft.use_time ? : now) - now;
if (tmo <= 0) if (tmo <= 0)
goto expired; goto expired;
if (tmo < next) if (tmo < next)
...@@ -130,9 +130,9 @@ static void xfrm_timer_handler(unsigned long data) ...@@ -130,9 +130,9 @@ static void xfrm_timer_handler(unsigned long data)
else if (tmo < next) else if (tmo < next)
next = tmo; next = tmo;
} }
if (x->lft.soft_use_expires_seconds && x->curlft.use_time) { if (x->lft.soft_use_expires_seconds) {
long tmo = x->lft.soft_use_expires_seconds + long tmo = x->lft.soft_use_expires_seconds +
x->curlft.use_time - now; (x->curlft.use_time ? : now) - now;
if (tmo <= 0) if (tmo <= 0)
warn = 1; warn = 1;
else if (tmo < next) else if (tmo < next)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment