All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated
@ 2011-05-24  8:20 Jozsef Kadlecsik
  2011-05-24  8:20 ` [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Jozsef Kadlecsik @ 2011-05-24  8:20 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Patrick McHardy, Jozsef Kadlecsik

Hi Patrick,

Here follows three patches against net-2.6/nf-2.6, please apply them
(and discard the patches I sent on last Friday).

Best regards,
Jozsef

Jozsef Kadlecsik (3):
  netfilter: ipset: Use proper timeout value to jiffies conversion
  netfilter: ipset: remove unused variable from type_pf_tdel()
  netfilter: ipset: fix ip_set_flush return code

 include/linux/netfilter/ipset/ip_set_ahash.h   |    4 ++--
 include/linux/netfilter/ipset/ip_set_timeout.h |   18 ++++++++++--------
 net/netfilter/ipset/ip_set_core.c              |    2 +-
 3 files changed, 13 insertions(+), 11 deletions(-)


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

* [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion
  2011-05-24  8:20 [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated Jozsef Kadlecsik
@ 2011-05-24  8:20 ` Jozsef Kadlecsik
  2011-05-24  8:20   ` [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel() Jozsef Kadlecsik
  2011-05-24 14:34   ` [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion Patrick McHardy
  2011-05-24 14:32 ` [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated Patrick McHardy
  2011-05-26 17:08 ` Pablo Neira Ayuso
  2 siblings, 2 replies; 11+ messages in thread
From: Jozsef Kadlecsik @ 2011-05-24  8:20 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Patrick McHardy, 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] 11+ messages in thread

* [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel()
  2011-05-24  8:20 ` [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
@ 2011-05-24  8:20   ` Jozsef Kadlecsik
  2011-05-24  8:20     ` [PATCH 3/3] netfilter: ipset: fix ip_set_flush return code Jozsef Kadlecsik
  2011-05-24 14:40     ` [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel() Patrick McHardy
  2011-05-24 14:34   ` [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion Patrick McHardy
  1 sibling, 2 replies; 11+ messages in thread
From: Jozsef Kadlecsik @ 2011-05-24  8:20 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Patrick McHardy, 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] 11+ messages in thread

* [PATCH 3/3] netfilter: ipset: fix ip_set_flush return code
  2011-05-24  8:20   ` [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel() Jozsef Kadlecsik
@ 2011-05-24  8:20     ` Jozsef Kadlecsik
  2011-05-24 14:46       ` Patrick McHardy
  2011-05-24 14:40     ` [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel() Patrick McHardy
  1 sibling, 1 reply; 11+ messages in thread
From: Jozsef Kadlecsik @ 2011-05-24  8:20 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Patrick McHardy, Jozsef Kadlecsik

ip_set_flush returned -EPROTO instead of -IPSET_ERR_PROTOCOL, fixed

Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
---
 net/netfilter/ipset/ip_set_core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index 72d1ac6..8041bef 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -815,7 +815,7 @@ ip_set_flush(struct sock *ctnl, struct sk_buff *skb,
 	ip_set_id_t i;
 
 	if (unlikely(protocol_failed(attr)))
-		return -EPROTO;
+		return -IPSET_ERR_PROTOCOL;
 
 	if (!attr[IPSET_ATTR_SETNAME]) {
 		for (i = 0; i < ip_set_max; i++)
-- 
1.7.0.4


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

* Re: [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated
  2011-05-24  8:20 [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated Jozsef Kadlecsik
  2011-05-24  8:20 ` [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
@ 2011-05-24 14:32 ` Patrick McHardy
  2011-05-26 17:08 ` Pablo Neira Ayuso
  2 siblings, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2011-05-24 14:32 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel

On 24.05.2011 10:20, Jozsef Kadlecsik wrote:
> Hi Patrick,
> 
> Here follows three patches against net-2.6/nf-2.6, please apply them
> (and discard the patches I sent on last Friday).

Will do, thanks.

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

* Re: [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion
  2011-05-24  8:20 ` [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
  2011-05-24  8:20   ` [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel() Jozsef Kadlecsik
@ 2011-05-24 14:34   ` Patrick McHardy
  1 sibling, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2011-05-24 14:34 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel

On 24.05.2011 10:20, Jozsef Kadlecsik wrote:
> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>

Applied, thanks.

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

* Re: [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel()
  2011-05-24  8:20   ` [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel() Jozsef Kadlecsik
  2011-05-24  8:20     ` [PATCH 3/3] netfilter: ipset: fix ip_set_flush return code Jozsef Kadlecsik
@ 2011-05-24 14:40     ` Patrick McHardy
  1 sibling, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2011-05-24 14:40 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel

On 24.05.2011 10:20, Jozsef Kadlecsik wrote:
> Variable 'ret' is set in type_pf_tdel() but not used, remove.

I'll qualify this as a bugfix since it removes a warning.

Applied, thanks.

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

* Re: [PATCH 3/3] netfilter: ipset: fix ip_set_flush return code
  2011-05-24  8:20     ` [PATCH 3/3] netfilter: ipset: fix ip_set_flush return code Jozsef Kadlecsik
@ 2011-05-24 14:46       ` Patrick McHardy
  0 siblings, 0 replies; 11+ messages in thread
From: Patrick McHardy @ 2011-05-24 14:46 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel

On 24.05.2011 10:20, Jozsef Kadlecsik wrote:
> ip_set_flush returned -EPROTO instead of -IPSET_ERR_PROTOCOL, fixed

Applied, thanks.

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

* Re: [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated
  2011-05-24  8:20 [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated Jozsef Kadlecsik
  2011-05-24  8:20 ` [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
  2011-05-24 14:32 ` [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated Patrick McHardy
@ 2011-05-26 17:08 ` Pablo Neira Ayuso
  2011-05-26 17:12   ` Patrick McHardy
  2 siblings, 1 reply; 11+ messages in thread
From: Pablo Neira Ayuso @ 2011-05-26 17:08 UTC (permalink / raw)
  To: Jozsef Kadlecsik; +Cc: netfilter-devel, Patrick McHardy

On 24/05/11 10:20, Jozsef Kadlecsik wrote:
> Hi Patrick,
> 
> Here follows three patches against net-2.6/nf-2.6, please apply them
> (and discard the patches I sent on last Friday).

OK, I'm removing the ones you sent last Friday to take these.

They're now in my tree.

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

* Re: [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated
  2011-05-26 17:08 ` Pablo Neira Ayuso
@ 2011-05-26 17:12   ` Patrick McHardy
  2011-05-26 17:30     ` Pablo Neira Ayuso
  0 siblings, 1 reply; 11+ messages in thread
From: Patrick McHardy @ 2011-05-26 17:12 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Jozsef Kadlecsik, netfilter-devel

Am 26.05.2011 19:08, schrieb Pablo Neira Ayuso:
> On 24/05/11 10:20, Jozsef Kadlecsik wrote:
>> Hi Patrick,
>>
>> Here follows three patches against net-2.6/nf-2.6, please apply them
>> (and discard the patches I sent on last Friday).
> 
> OK, I'm removing the ones you sent last Friday to take these.

Yeah, I can't access that tree right now (some network problem),
but I'll push them out as soon as its working again.


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

* Re: [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated
  2011-05-26 17:12   ` Patrick McHardy
@ 2011-05-26 17:30     ` Pablo Neira Ayuso
  0 siblings, 0 replies; 11+ messages in thread
From: Pablo Neira Ayuso @ 2011-05-26 17:30 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: Jozsef Kadlecsik, netfilter-devel

On 26/05/11 19:12, Patrick McHardy wrote:
> Am 26.05.2011 19:08, schrieb Pablo Neira Ayuso:
>> On 24/05/11 10:20, Jozsef Kadlecsik wrote:
>>> Hi Patrick,
>>>
>>> Here follows three patches against net-2.6/nf-2.6, please apply them
>>> (and discard the patches I sent on last Friday).
>>
>> OK, I'm removing the ones you sent last Friday to take these.
> 
> Yeah, I can't access that tree right now (some network problem),
> but I'll push them out as soon as its working again.

I can send these five patches to davem by tomorrow morning:

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

I'm going to compile/test them along today.

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

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

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-24  8:20 [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated Jozsef Kadlecsik
2011-05-24  8:20 ` [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion Jozsef Kadlecsik
2011-05-24  8:20   ` [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel() Jozsef Kadlecsik
2011-05-24  8:20     ` [PATCH 3/3] netfilter: ipset: fix ip_set_flush return code Jozsef Kadlecsik
2011-05-24 14:46       ` Patrick McHardy
2011-05-24 14:40     ` [PATCH 2/3] netfilter: ipset: remove unused variable from type_pf_tdel() Patrick McHardy
2011-05-24 14:34   ` [PATCH 1/3] netfilter: ipset: Use proper timeout value to jiffies conversion Patrick McHardy
2011-05-24 14:32 ` [PATCH 0/3] ipset patches against net-2.6/nf-2.6, updated Patrick McHardy
2011-05-26 17:08 ` Pablo Neira Ayuso
2011-05-26 17:12   ` Patrick McHardy
2011-05-26 17:30     ` 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.