firewall3: fix handling of UTC times
authorJo-Philipp Wich <jo@mein.io>
Wed, 22 Feb 2017 09:46:58 +0000 (10:46 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 22 Feb 2017 09:47:00 +0000 (10:47 +0100)
The --utc parameter is deprecated and UTC times are the default now.
To achieve local time, the --kenreltz param has to be passed instead
so invert the logic and swap --utc with --kerneltz.

Fixes #548.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
iptables.c

index 2f28781..10bfea5 100644 (file)
@@ -1019,8 +1019,8 @@ fw3_ipt_rule_time(struct fw3_ipt_rule *r, struct fw3_time *time)
 
        fw3_ipt_rule_addarg(r, false, "-m", "time");
 
-       if (time->utc)
-               fw3_ipt_rule_addarg(r, false, "--utc", NULL);
+       if (!time->utc)
+               fw3_ipt_rule_addarg(r, false, "--kerneltz", NULL);
 
        if (d1)
        {