mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
xt_hardidletiemr: Check for remaining expiry time
-xt_hardidletimers are getting reset with addition/ deletion of any iptable rule in any chain of raw/mangle table. -Check and restart the timer with remaining expiry time. Change-Id: I55c6fb211b929dfe500edda8e7c01530f944b067 CRs-Fixed: 2367114 Acked-by: Manoj Basapathi <manojbm@qti.qualcomm.com> Signed-off-by: Devi Sandeep Endluri V V <dendluri@codeaurora.org>
This commit is contained in:
parent
ccc4db28d5
commit
2cebfbfb2d
@ -237,6 +237,9 @@ static int hardidletimer_tg_checkentry(const struct xt_tgchk_param *par)
|
||||
struct hardidletimer_tg_info *info = par->targinfo;
|
||||
int ret;
|
||||
ktime_t tout;
|
||||
struct timespec ktimespec;
|
||||
|
||||
memset(&ktimespec, 0, sizeof(struct timespec));
|
||||
|
||||
pr_debug("checkentry targinfo %s\n", info->label);
|
||||
|
||||
@ -257,14 +260,15 @@ static int hardidletimer_tg_checkentry(const struct xt_tgchk_param *par)
|
||||
info->timer = __hardidletimer_tg_find_by_label(info->label);
|
||||
if (info->timer) {
|
||||
info->timer->refcnt++;
|
||||
if (!info->timer->active) {
|
||||
schedule_work(&info->timer->work);
|
||||
pr_debug("Starting Checkentry timer\n");
|
||||
}
|
||||
/* calculate remaining expiry time */
|
||||
tout = alarm_expires_remaining(&info->timer->alarm);
|
||||
ktimespec = ktime_to_timespec(tout);
|
||||
|
||||
info->timer->active = true;
|
||||
tout = ktime_set(info->timeout, 0);
|
||||
alarm_start_relative(&info->timer->alarm, tout);
|
||||
if (ktimespec.tv_sec > 0) {
|
||||
pr_debug("time_expiry_remaining %ld\n",
|
||||
ktimespec.tv_sec);
|
||||
alarm_start_relative(&info->timer->alarm, tout);
|
||||
}
|
||||
|
||||
pr_debug("increased refcnt of timer %s to %u\n",
|
||||
info->label, info->timer->refcnt);
|
||||
|
Loading…
x
Reference in New Issue
Block a user