Skip to content

Commit 7ac5dae

Browse files
author
MorganaFuture
committed
fix: process context warning
1 parent 21137af commit 7ac5dae

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tls/tls_ticket.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ ttls_ticket_get_time(unsigned long lifetime)
7474
struct timespec64 ts;
7575
unsigned long ts_sec;
7676

77-
tfw_current_timestamp_real(&ts);
77+
/*
78+
* This function is called from both process context
79+
* (ttls_tickets_configure) and softirq context
80+
* (ttls_ticket_rotate_keys timer callback).
81+
*/
82+
if (in_softirq()) {
83+
tfw_current_timestamp_ts64(&ts);
84+
} else {
85+
tfw_current_timestamp_real(&ts);
86+
}
7887
ts_sec = ts.tv_sec;
7988
ts_sec -= ts_sec % lifetime;
8089

0 commit comments

Comments
 (0)