All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] ipset patches against net-2.6/nf-2.6
@ 2011-05-20 18:51 Jozsef Kadlecsik
  2011-05-20 18:51 ` [PATCH 1/2] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
  2011-05-26 16:41 ` [PATCH 0/2] ipset patches against net-2.6/nf-2.6 Pablo Neira Ayuso
  0 siblings, 2 replies; 5+ messages in thread
From: Jozsef Kadlecsik @ 2011-05-20 18:51 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Patrick McHardy, David Miller, Jozsef Kadlecsik

Hi Dave and Patrick,

Here follows two patches against net-2.6/nf-2.6, please apply them.

Best regards,
Jozsef

Jozsef Kadlecsik (2):
  netfilter: ipset: Use proper timeout value to jiffies conversion
  netfilter: ipset: remove unused variable from type_pf_tdel()

 include/linux/netfilter/ipset/ip_set_ahash.h   |    4 ++--
 include/linux/netfilter/ipset/ip_set_timeout.h |   18 ++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] netfilter: ipset: Use proper timeout value to jiffies conversion
  2011-05-20 18:51 [PATCH 0/2] ipset patches against net-2.6/nf-2.6 Jozsef Kadlecsik
@ 2011-05-20 18:51 ` Jozsef Kadlecsik
  2011-05-20 18:51   ` [PATCH 2/2] netfilter: ipset: remove unused variable from type_pf_tdel() Jozsef Kadlecsik
  2011-05-26 16:41 ` [PATCH 0/2] ipset patches against net-2.6/nf-2.6 Pablo Neira Ayuso
  1 sibling, 1 reply; 5+ messages in thread
From: Jozsef Kadlecsik @ 2011-05-20 18:51 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Patrick McHardy, David Miller, Jozsef Kadlecsik


Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
---
 include/linux/netfilter/ipset/ip_set_timeout.h |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h
index 9f30c5f..bcdd40a 100644
--- a/include/linux/netfilter/ipset/ip_set_timeout.h
+++ b/include/linux/netfilter/ipset/ip_set_timeout.h
@@ -45,7 +45,7 @@ ip_set_timeout_test(unsigned long timeout)
 {
 	return timeout != IPSET_ELEM_UNSET &&
 	       (timeout == IPSET_ELEM_PERMANENT ||
-		time_after(timeout, jiffies));
+		time_is_after_jiffies(timeout));
 }
 
 static inline bool
@@ -53,7 +53,7 @@ ip_set_timeout_expired(unsigned long timeout)
 {
 	return timeout != IPSET_ELEM_UNSET &&
 	       timeout != IPSET_ELEM_PERMANENT &&
-	       time_before(timeout, jiffies);
+	       time_is_before_jiffies(timeout);
 }
 
 static inline unsigned long
@@ -64,7 +64,7 @@ ip_set_timeout_set(u32 timeout)
 	if (!timeout)
 		return IPSET_ELEM_PERMANENT;
 
-	t = timeout * HZ + jiffies;
+	t = msecs_to_jiffies(timeout * 1000) + jiffies;
 	if (t == IPSET_ELEM_UNSET || t == IPSET_ELEM_PERMANENT)
 		/* Bingo! */
 		t++;
@@ -75,7 +75,8 @@ ip_set_timeout_set(u32 timeout)
 static inline u32
 ip_set_timeout_get(unsigned long timeout)
 {
-	return timeout == IPSET_ELEM_PERMANENT ? 0 : (timeout - jiffies)/HZ;
+	return timeout == IPSET_ELEM_PERMANENT ? 0 : 
+		jiffies_to_msecs(timeout - jiffies)/1000;
 }
 
 #else
@@ -89,14 +90,14 @@ static inline bool
 ip_set_timeout_test(unsigned long timeout)
 {
 	return timeout == IPSET_ELEM_PERMANENT ||
-	       time_after(timeout, jiffies);
+	       time_is_after_jiffies(timeout);
 }
 
 static inline bool
 ip_set_timeout_expired(unsigned long timeout)
 {
 	return timeout != IPSET_ELEM_PERMANENT &&
-	       time_before(timeout, jiffies);
+	       time_is_before_jiffies(timeout);
 }
 
 static inline unsigned long
@@ -107,7 +108,7 @@ ip_set_timeout_set(u32 timeout)
 	if (!timeout)
 		return IPSET_ELEM_PERMANENT;
 
-	t = timeout * HZ + jiffies;
+	t = msecs_to_jiffies(timeout * 1000) + jiffies;
 	if (t == IPSET_ELEM_PERMANENT)
 		/* Bingo! :-) */
 		t++;
@@ -118,7 +119,8 @@ ip_set_timeout_set(u32 timeout)
 static inline u32
 ip_set_timeout_get(unsigned long timeout)
 {
-	return timeout == IPSET_ELEM_PERMANENT ? 0 : (timeout - jiffies)/HZ;
+	return timeout == IPSET_ELEM_PERMANENT ? 0 :
+		jiffies_to_msecs(timeout - jiffies)/1000;
 }
 #endif /* ! IP_SET_BITMAP_TIMEOUT */
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] netfilter: ipset: remove unused variable from type_pf_tdel()
  2011-05-20 18:51 ` [PATCH 1/2] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
@ 2011-05-20 18:51   ` Jozsef Kadlecsik
  2011-05-20 18:57     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Jozsef Kadlecsik @ 2011-05-20 18:51 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Patrick McHardy, David Miller, Jozsef Kadlecsik

Variable 'ret' is set in type_pf_tdel() but not used, remove.

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
---
 include/linux/netfilter/ipset/ip_set_ahash.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index a0196ac..ac3c822 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -839,7 +839,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout)
 	struct htable *t = h->table;
 	const struct type_pf_elem *d = value;
 	struct hbucket *n;
-	int i, ret = 0;
+	int i;
 	struct type_pf_elem *data;
 	u32 key;
 
@@ -850,7 +850,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout)
 		if (!type_pf_data_equal(data, d))
 			continue;
 		if (type_pf_data_expired(data))
-			ret = -IPSET_ERR_EXIST;
+			return -IPSET_ERR_EXIST;
 		if (i != n->pos - 1)
 			/* Not last one */
 			type_pf_data_copy(data, ahash_tdata(n, n->pos - 1));
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] netfilter: ipset: remove unused variable from type_pf_tdel()
  2011-05-20 18:51   ` [PATCH 2/2] netfilter: ipset: remove unused variable from type_pf_tdel() Jozsef Kadlecsik
@ 2011-05-20 18:57     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2011-05-20 18:57 UTC (permalink / raw)
  To: kadlec; +Cc: netfilter-devel, kaber

From: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Date: Fri, 20 May 2011 20:51:43 +0200

> Variable 'ret' is set in type_pf_tdel() but not used, remove.
> 
> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] ipset patches against net-2.6/nf-2.6
  2011-05-20 18:51 [PATCH 0/2] ipset patches against net-2.6/nf-2.6 Jozsef Kadlecsik
  2011-05-20 18:51 ` [PATCH 1/2] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
@ 2011-05-26 16:41 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 5+ messages in thread
From: Pablo Neira Ayuso @ 2011-05-26 16:41 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel, Patrick McHardy, David Miller

On 20/05/11 20:51, Jozsef Kadlecsik wrote:
> Hi Dave and Patrick,
> 
> Here follows two patches against net-2.6/nf-2.6, please apply them.
> 
> Best regards,
> Jozsef
> 
> Jozsef Kadlecsik (2):
>   netfilter: ipset: Use proper timeout value to jiffies conversion
>   netfilter: ipset: remove unused variable from type_pf_tdel()

Thanks, I have applied these patches to my tree.

http://1984.lsi.us.es/git/?p=net-2.6/.git;a=shortlog;h=refs/heads/pablo/nf-2.6-updates

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-26 16:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-20 18:51 [PATCH 0/2] ipset patches against net-2.6/nf-2.6 Jozsef Kadlecsik
2011-05-20 18:51 ` [PATCH 1/2] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
2011-05-20 18:51   ` [PATCH 2/2] netfilter: ipset: remove unused variable from type_pf_tdel() Jozsef Kadlecsik
2011-05-20 18:57     ` David Miller
2011-05-26 16:41 ` [PATCH 0/2] ipset patches against net-2.6/nf-2.6 Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.