[netfilter-cvslog] r4436 -
trunk/patch-o-matic-ng/patchlets/time/linux-2.6/net/ipv4/netfilter
laforge at netfilter.org
laforge at netfilter.org
Thu Nov 3 19:20:26 CET 2005
Author: laforge at netfilter.org
Date: 2005-11-03 19:20:25 +0100 (Thu, 03 Nov 2005)
New Revision: 4436
Modified:
trunk/patch-o-matic-ng/patchlets/time/linux-2.6/net/ipv4/netfilter/ipt_time.c
Log:
fix 'time' match for 2.6.14 (Krzysztof Oledzki)
Modified: trunk/patch-o-matic-ng/patchlets/time/linux-2.6/net/ipv4/netfilter/ipt_time.c
===================================================================
--- trunk/patch-o-matic-ng/patchlets/time/linux-2.6/net/ipv4/netfilter/ipt_time.c 2005-11-03 18:07:55 UTC (rev 4435)
+++ trunk/patch-o-matic-ng/patchlets/time/linux-2.6/net/ipv4/netfilter/ipt_time.c 2005-11-03 18:20:25 UTC (rev 4436)
@@ -40,7 +40,7 @@
};
void
-localtime(const time_t *timepr, struct tm *r);
+localtime(const u32 time, struct tm *r);
static int
match(const struct sk_buff *skb,
@@ -56,15 +56,15 @@
u_int16_t packet_time;
/* We might not have a timestamp, get one */
- if (skb->stamp.tv_sec == 0)
- do_gettimeofday((struct timeval *)&skb->stamp);
+ if (skb->tstamp.off_sec == 0)
+ __net_timestamp((struct sk_buff *)skb);
/* First we make sure we are in the date start-stop boundaries */
- if ((skb->stamp.tv_sec < info->date_start) || (skb->stamp.tv_sec > info->date_stop))
+ if ((skb->tstamp.off_sec < info->date_start) || (skb->tstamp.off_sec > info->date_stop))
return 0; /* We are outside the date boundaries */
/* Transform the timestamp of the packet, in a human readable form */
- localtime(&skb->stamp.tv_sec, ¤ttime);
+ localtime(skb->tstamp.off_sec, ¤ttime);
/* check if we match this timestamp, we start by the days... */
if ((days_of_week[currenttime.tm_wday] & info->days_match) != days_of_week[currenttime.tm_wday])
@@ -139,9 +139,8 @@
#define SPD 24*60*60
void
-localtime(const time_t *timepr, struct tm *r) {
- time_t i;
- time_t timep;
+localtime(const u32 time, struct tm *r) {
+ u32 i, timep;
extern struct timezone sys_tz;
const unsigned int __spm[12] =
{ 0,
@@ -157,9 +156,9 @@
(31+28+31+30+31+30+31+31+30+31),
(31+28+31+30+31+30+31+31+30+31+30),
};
- register time_t work;
+ register u32 work;
- timep = (*timepr) - (sys_tz.tz_minuteswest * 60);
+ timep = time - (sys_tz.tz_minuteswest * 60);
work=timep%(SPD);
r->tm_sec=work%60; work/=60;
r->tm_min=work%60; r->tm_hour=work/60;
More information about the netfilter-cvslog
mailing list