diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/netfilter/xt_time.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/net/netfilter/xt_time.c b/net/netfilter/xt_time.c index e9a8794bc3ab..9fa2e0824708 100644 --- a/net/netfilter/xt_time.c +++ b/net/netfilter/xt_time.c | |||
@@ -95,8 +95,11 @@ static inline void localtime_2(struct xtm *r, time_t time) | |||
95 | */ | 95 | */ |
96 | r->dse = time / 86400; | 96 | r->dse = time / 86400; |
97 | 97 | ||
98 | /* 1970-01-01 (w=0) was a Thursday (4). */ | 98 | /* |
99 | r->weekday = (4 + r->dse) % 7; | 99 | * 1970-01-01 (w=0) was a Thursday (4). |
100 | * -1 and +1 map Sunday properly onto 7. | ||
101 | */ | ||
102 | r->weekday = (4 + r->dse - 1) % 7 + 1; | ||
100 | } | 103 | } |
101 | 104 | ||
102 | static void localtime_3(struct xtm *r, time_t time) | 105 | static void localtime_3(struct xtm *r, time_t time) |