diff options
| author | David S. Miller <davem@davemloft.net> | 2011-05-27 13:04:40 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2011-05-27 13:04:40 -0400 |
| commit | 58bf2dbccc5aca12df77e2328f478e239a68bdd5 (patch) | |
| tree | 3eb8009d5029e2b5b07325c9dba1709413677395 /include/linux | |
| parent | 86e4ca66e81bba0f8640f1fa19b8b8f72cbd0561 (diff) | |
| parent | c74c0bfe0b61cf41a897c2444c038e0d3f600556 (diff) | |
Merge branch 'pablo/nf-2.6-updates' of git://1984.lsi.us.es/net-2.6
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/netfilter/ipset/ip_set_ahash.h | 4 | ||||
| -rw-r--r-- | include/linux/netfilter/ipset/ip_set_timeout.h | 18 |
2 files changed, 12 insertions, 10 deletions
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index a0196ac79051..ac3c822eb39a 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) | |||
| 839 | struct htable *t = h->table; | 839 | struct htable *t = h->table; |
| 840 | const struct type_pf_elem *d = value; | 840 | const struct type_pf_elem *d = value; |
| 841 | struct hbucket *n; | 841 | struct hbucket *n; |
| 842 | int i, ret = 0; | 842 | int i; |
| 843 | struct type_pf_elem *data; | 843 | struct type_pf_elem *data; |
| 844 | u32 key; | 844 | u32 key; |
| 845 | 845 | ||
| @@ -850,7 +850,7 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout) | |||
| 850 | if (!type_pf_data_equal(data, d)) | 850 | if (!type_pf_data_equal(data, d)) |
| 851 | continue; | 851 | continue; |
| 852 | if (type_pf_data_expired(data)) | 852 | if (type_pf_data_expired(data)) |
| 853 | ret = -IPSET_ERR_EXIST; | 853 | return -IPSET_ERR_EXIST; |
| 854 | if (i != n->pos - 1) | 854 | if (i != n->pos - 1) |
| 855 | /* Not last one */ | 855 | /* Not last one */ |
| 856 | type_pf_data_copy(data, ahash_tdata(n, n->pos - 1)); | 856 | type_pf_data_copy(data, ahash_tdata(n, n->pos - 1)); |
diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h index 9f30c5f2ec1c..bcdd40ad39ed 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) | |||
| 45 | { | 45 | { |
| 46 | return timeout != IPSET_ELEM_UNSET && | 46 | return timeout != IPSET_ELEM_UNSET && |
| 47 | (timeout == IPSET_ELEM_PERMANENT || | 47 | (timeout == IPSET_ELEM_PERMANENT || |
| 48 | time_after(timeout, jiffies)); | 48 | time_is_after_jiffies(timeout)); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | static inline bool | 51 | static inline bool |
| @@ -53,7 +53,7 @@ ip_set_timeout_expired(unsigned long timeout) | |||
| 53 | { | 53 | { |
| 54 | return timeout != IPSET_ELEM_UNSET && | 54 | return timeout != IPSET_ELEM_UNSET && |
| 55 | timeout != IPSET_ELEM_PERMANENT && | 55 | timeout != IPSET_ELEM_PERMANENT && |
| 56 | time_before(timeout, jiffies); | 56 | time_is_before_jiffies(timeout); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | static inline unsigned long | 59 | static inline unsigned long |
| @@ -64,7 +64,7 @@ ip_set_timeout_set(u32 timeout) | |||
| 64 | if (!timeout) | 64 | if (!timeout) |
| 65 | return IPSET_ELEM_PERMANENT; | 65 | return IPSET_ELEM_PERMANENT; |
| 66 | 66 | ||
| 67 | t = timeout * HZ + jiffies; | 67 | t = msecs_to_jiffies(timeout * 1000) + jiffies; |
| 68 | if (t == IPSET_ELEM_UNSET || t == IPSET_ELEM_PERMANENT) | 68 | if (t == IPSET_ELEM_UNSET || t == IPSET_ELEM_PERMANENT) |
| 69 | /* Bingo! */ | 69 | /* Bingo! */ |
| 70 | t++; | 70 | t++; |
| @@ -75,7 +75,8 @@ ip_set_timeout_set(u32 timeout) | |||
| 75 | static inline u32 | 75 | static inline u32 |
| 76 | ip_set_timeout_get(unsigned long timeout) | 76 | ip_set_timeout_get(unsigned long timeout) |
| 77 | { | 77 | { |
| 78 | return timeout == IPSET_ELEM_PERMANENT ? 0 : (timeout - jiffies)/HZ; | 78 | return timeout == IPSET_ELEM_PERMANENT ? 0 : |
| 79 | jiffies_to_msecs(timeout - jiffies)/1000; | ||
| 79 | } | 80 | } |
| 80 | 81 | ||
| 81 | #else | 82 | #else |
| @@ -89,14 +90,14 @@ static inline bool | |||
| 89 | ip_set_timeout_test(unsigned long timeout) | 90 | ip_set_timeout_test(unsigned long timeout) |
| 90 | { | 91 | { |
| 91 | return timeout == IPSET_ELEM_PERMANENT || | 92 | return timeout == IPSET_ELEM_PERMANENT || |
| 92 | time_after(timeout, jiffies); | 93 | time_is_after_jiffies(timeout); |
| 93 | } | 94 | } |
| 94 | 95 | ||
| 95 | static inline bool | 96 | static inline bool |
| 96 | ip_set_timeout_expired(unsigned long timeout) | 97 | ip_set_timeout_expired(unsigned long timeout) |
| 97 | { | 98 | { |
| 98 | return timeout != IPSET_ELEM_PERMANENT && | 99 | return timeout != IPSET_ELEM_PERMANENT && |
| 99 | time_before(timeout, jiffies); | 100 | time_is_before_jiffies(timeout); |
| 100 | } | 101 | } |
| 101 | 102 | ||
| 102 | static inline unsigned long | 103 | static inline unsigned long |
| @@ -107,7 +108,7 @@ ip_set_timeout_set(u32 timeout) | |||
| 107 | if (!timeout) | 108 | if (!timeout) |
| 108 | return IPSET_ELEM_PERMANENT; | 109 | return IPSET_ELEM_PERMANENT; |
| 109 | 110 | ||
| 110 | t = timeout * HZ + jiffies; | 111 | t = msecs_to_jiffies(timeout * 1000) + jiffies; |
| 111 | if (t == IPSET_ELEM_PERMANENT) | 112 | if (t == IPSET_ELEM_PERMANENT) |
| 112 | /* Bingo! :-) */ | 113 | /* Bingo! :-) */ |
| 113 | t++; | 114 | t++; |
| @@ -118,7 +119,8 @@ ip_set_timeout_set(u32 timeout) | |||
| 118 | static inline u32 | 119 | static inline u32 |
| 119 | ip_set_timeout_get(unsigned long timeout) | 120 | ip_set_timeout_get(unsigned long timeout) |
| 120 | { | 121 | { |
| 121 | return timeout == IPSET_ELEM_PERMANENT ? 0 : (timeout - jiffies)/HZ; | 122 | return timeout == IPSET_ELEM_PERMANENT ? 0 : |
| 123 | jiffies_to_msecs(timeout - jiffies)/1000; | ||
| 122 | } | 124 | } |
| 123 | #endif /* ! IP_SET_BITMAP_TIMEOUT */ | 125 | #endif /* ! IP_SET_BITMAP_TIMEOUT */ |
| 124 | 126 | ||
