--- ipt_time.c.orig 2005-11-03 19:20:25.000000000 +0100 +++ ipt_time.c 2006-01-03 10:14:35.000000000 +0100 @@ -11,6 +11,7 @@ 2001-30-11 Fabrice : added the possibility to use the match in FORWARD/OUTPUT with a little hack, added Nguyen Dang Phuoc Dong patch to support timezones. 2004-05-02 Fabrice : added support for date matching, from an idea of Fabien COELHO. + 2006-01-03 Heiko Schlittermann : added support for timestart > timestop */ #include @@ -72,11 +73,14 @@ /* ... check the time now */ packet_time = (currenttime.tm_hour * 60) + currenttime.tm_min; - if ((packet_time < info->time_start) || (packet_time > info->time_stop)) - return 0; - /* here we match ! */ - return 1; + /* .hs now start > stop is possible */ + + if (info->time_start > info->time_stop) + return (packet_time >= info->time_start) || (packet_time < info->time_stop); + + return (packet_time >= info->time_start) && (packet_time < info->time_stop); + } static int