Skip to content

Commit 99565a6

Browse files
Fan Duklassert
authored andcommitted
xfrm: Make xfrm_state timer monotonic
xfrm_state timer should be independent of system clock change, so switch to CLOCK_BOOTTIME base which is not only monotonic but also counting suspend time. Thus issue reported in commit: 9e0d57f ("xfrm: SAD entries do not expire correctly after suspend-resume") could ALSO be avoided. v2: Use CLOCK_BOOTTIME to count suspend time, but still monotonic. Signed-off-by: Fan Du <fan.du@windriver.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
1 parent af83fde commit 99565a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/xfrm/xfrm_state.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
499499
INIT_HLIST_NODE(&x->bydst);
500500
INIT_HLIST_NODE(&x->bysrc);
501501
INIT_HLIST_NODE(&x->byspi);
502-
tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_REALTIME, HRTIMER_MODE_ABS);
502+
tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler,
503+
CLOCK_BOOTTIME, HRTIMER_MODE_ABS);
503504
setup_timer(&x->rtimer, xfrm_replay_timer_handler,
504505
(unsigned long)x);
505506
x->curlft.add_time = get_seconds();

0 commit comments

Comments
 (0)