Skip to content

Commit

Permalink
netfilter 08/09: xt_time: print timezone for user information
Browse files Browse the repository at this point in the history
netfilter: xt_time: print timezone for user information

Let users have a way to figure out if their distro set the kernel
timezone at all.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jan Engelhardt authored and David S. Miller committed Jan 13, 2009
1 parent cd7fcbf commit e6210f3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions net/netfilter/xt_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,17 @@ static struct xt_match xt_time_mt_reg __read_mostly = {

static int __init time_mt_init(void)
{
int minutes = sys_tz.tz_minuteswest;

if (minutes < 0) /* east of Greenwich */
printk(KERN_INFO KBUILD_MODNAME
": kernel timezone is +%02d%02d\n",
-minutes / 60, -minutes % 60);
else /* west of Greenwich */
printk(KERN_INFO KBUILD_MODNAME
": kernel timezone is -%02d%02d\n",
minutes / 60, minutes % 60);

return xt_register_match(&xt_time_mt_reg);
}

Expand Down

0 comments on commit e6210f3

Please sign in to comment.