From: "flichtenheld (Code Review)" Date: Tue, 29 Jul 2025 12:33:55 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="KjQMGRRQDZA="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: list: Make types of hash elements consistent List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --KjQMGRRQDZA= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1119?usp=3Demail to review the following change. Change subject: list: Make types of hash elements consistent ...................................................................... list: Make types of hash elements consistent Really no use in having the indices and limits in int. Change-Id: I3334465738fb1fbf508dfd719b6a238b500cc0ae Signed-off-by: Frank Lichtenheld --- M src/openvpn/integer.h M src/openvpn/list.c M src/openvpn/list.h M src/openvpn/multi.c M src/openvpn/multi.h M src/openvpn/options.c M src/openvpn/options.h M tests/unit_tests/openvpn/test_misc.c 8 files changed, 63 insertions(+), 50 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/19/1119/1 diff --git a/src/openvpn/integer.h b/src/openvpn/integer.h index c568036..e6106c9 100644 --- a/src/openvpn/integer.h +++ b/src/openvpn/integer.h @@ -132,6 +132,27 @@ } } +static inline unsigned int +constrain_uint(unsigned int x, unsigned int min, unsigned int max) +{ + if (min > max) + { + return min; + } + if (x < min) + { + return min; + } + else if (x > max) + { + return max; + } + else + { + return x; + } +} + /* * Functions used for circular buffer index arithmetic. */ diff --git a/src/openvpn/list.c b/src/openvpn/list.c index 1f33b5f..3971d62 100644 --- a/src/openvpn/list.c +++ b/src/openvpn/list.c @@ -35,23 +35,22 @@ #include "memdbg.h" struct hash * -hash_init(const int n_buckets, +hash_init(const uint32_t n_buckets, const uint32_t iv, uint32_t (*hash_function)(const void *key, uint32_t iv), bool (*compare_function)(const void *key1, const void *key2)) { struct hash *h; - int i; ASSERT(n_buckets > 0); ALLOC_OBJ_CLEAR(h, struct hash); - h->n_buckets =3D (int) adjust_power_of_2(n_buckets); + h->n_buckets =3D (uint32_t)adjust_power_of_2(n_buckets); h->mask =3D h->n_buckets - 1; h->hash_function =3D hash_function; h->compare_function =3D compare_function; h->iv =3D iv; ALLOC_ARRAY(h->buckets, struct hash_bucket, h->n_buckets); - for (i =3D 0; i < h->n_buckets; ++i) + for (uint32_t i =3D 0; i < h->n_buckets; ++i) { struct hash_bucket *b =3D &h->buckets[i]; b->list =3D NULL; @@ -62,8 +61,7 @@ void hash_free(struct hash *hash) { - int i; - for (i =3D 0; i < hash->n_buckets; ++i) + for (uint32_t i =3D 0; i < hash->n_buckets; ++i) { struct hash_bucket *b =3D &hash->buckets[i]; struct hash_element *he =3D b->list; @@ -222,15 +220,15 @@ void hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi, - int start_bucket, - int end_bucket) + uint32_t start_bucket, + uint32_t end_bucket) { if (end_bucket > hash->n_buckets) { end_bucket =3D hash->n_buckets; } - ASSERT(start_bucket >=3D 0 && start_bucket <=3D end_bucket); + ASSERT(start_bucket <=3D end_bucket); hi->hash =3D hash; hi->elem =3D NULL; @@ -336,6 +334,9 @@ * the return value. Every 1-bit and 2-bit delta achieves avalanche. * About 36+6len instructions. * + * #define hashsize(n) ((uint32_t)1<<(n)) + * #define hashmask(n) (hashsize(n)-1) + * * The best hash table sizes are powers of 2. There is no need to do * mod a prime (mod is sooo slow!). If you need less than 32 bits, * use a bitmask. For example, if you need only 10 bits, do diff --git a/src/openvpn/list.h b/src/openvpn/list.h index 783570f..d2c5373 100644 --- a/src/openvpn/list.h +++ b/src/openvpn/list.h @@ -37,14 +37,11 @@ #include "basic.h" #include "buffer.h" -#define hashsize(n) ((uint32_t)1<<(n)) -#define hashmask(n) (hashsize(n)-1) - struct hash_element { void *value; const void *key; - unsigned int hash_value; + uint32_t hash_value; struct hash_element *next; }; @@ -55,16 +52,16 @@ struct hash { - int n_buckets; - int n_elements; - int mask; + uint32_t n_buckets; + uint32_t n_elements; + uint32_t mask; uint32_t iv; uint32_t (*hash_function)(const void *key, uint32_t iv); bool (*compare_function)(const void *key1, const void *key2); /* retur= n true if equal */ struct hash_bucket *buckets; }; -struct hash *hash_init(const int n_buckets, +struct hash *hash_init(const uint32_t n_buckets, const uint32_t iv, uint32_t (*hash_function)(const void *key, uint32_t= iv), bool (*compare_function)(const void *key1, const vo= id *key2)); @@ -88,19 +85,19 @@ struct hash_iterator { struct hash *hash; - int bucket_index; + uint32_t bucket_index; struct hash_bucket *bucket; struct hash_element *elem; struct hash_element *last; bool bucket_marked; - int bucket_index_start; - int bucket_index_end; + uint32_t bucket_index_start; + uint32_t bucket_index_end; }; void hash_iterator_init_range(struct hash *hash, struct hash_iterator *hi, - int start_bucket, - int end_bucket); + uint32_t start_bucket, + uint32_t end_bucket); void hash_iterator_init(struct hash *hash, struct hash_iterator *iter); @@ -118,13 +115,13 @@ return (*hash->hash_function)(key, hash->iv); } -static inline int +static inline uint32_t hash_n_elements(const struct hash *hash) { return hash->n_elements; } -static inline int +static inline uint32_t hash_n_buckets(const struct hash *hash) { return hash->n_buckets; diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c index c0e8f9c..02157ac 100644 --- a/src/openvpn/multi.c +++ b/src/openvpn/multi.c @@ -175,19 +175,13 @@ static void multi_reap_range(const struct multi_context *m, - int start_bucket, - int end_bucket) + uint32_t start_bucket, + uint32_t end_bucket) { struct gc_arena gc =3D gc_new(); struct hash_iterator hi; struct hash_element *he; - if (start_bucket < 0) - { - start_bucket =3D 0; - end_bucket =3D hash_n_buckets(m->vhash); - } - dmsg(D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket, end_bu= cket); hash_iterator_init_range(m->vhash, &hi, start_bucket, end_bucket); while ((he =3D hash_iterator_next(&hi)) !=3D NULL) @@ -209,11 +203,11 @@ static void multi_reap_all(const struct multi_context *m) { - multi_reap_range(m, -1, 0); + multi_reap_range(m, 0, hash_n_buckets(m->vhash)); } static struct multi_reap * -multi_reap_new(int buckets_per_pass) +multi_reap_new(uint32_t buckets_per_pass) { struct multi_reap *mr; ALLOC_OBJ(mr, struct multi_reap); @@ -245,10 +239,10 @@ /* * How many buckets in vhash to reap per pass. */ -static int -reap_buckets_per_pass(int n_buckets) +static uint32_t +reap_buckets_per_pass(uint32_t n_buckets) { - return constrain_int(n_buckets / REAP_DIVISOR, REAP_MIN, REAP_MAX); + return constrain_uint(n_buckets / REAP_DIVISOR, REAP_MIN, REAP_MAX); } #ifdef ENABLE_MANAGEMENT diff --git a/src/openvpn/multi.h b/src/openvpn/multi.h index 3c821d7..a622e8c 100644 --- a/src/openvpn/multi.h +++ b/src/openvpn/multi.h @@ -52,8 +52,8 @@ */ struct multi_reap { - int bucket_base; - int buckets_per_pass; + uint32_t bucket_base; + uint32_t buckets_per_pass; time_t last_call; }; diff --git a/src/openvpn/options.c b/src/openvpn/options.c index d3ca340..9ca2c4a 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -7588,11 +7588,11 @@ } else if (streq(p[0], "hash-size") && p[1] && p[2] && !p[3]) { - int real, virtual; + uint32_t real, virtual; VERIFY_PERMISSION(OPT_P_GENERAL); - real =3D atoi_warn(p[1], msglevel); - virtual =3D atoi_warn(p[2], msglevel); + real =3D positive_atoi(p[1], msglevel); + virtual =3D positive_atoi(p[2], msglevel); if (real < 1 || virtual < 1) { msg(msglevel, "--hash-size sizes must be >=3D 1 (preferably a = power of 2)"); diff --git a/src/openvpn/options.h b/src/openvpn/options.h index 78b0d7c..9542d93 100644 --- a/src/openvpn/options.h +++ b/src/openvpn/options.h @@ -498,8 +498,8 @@ struct in6_addr ifconfig_ipv6_pool_base; /* IPv6 */ int ifconfig_ipv6_pool_netbits; /* IPv6 */ - int real_hash_size; - int virtual_hash_size; + uint32_t real_hash_size; + uint32_t virtual_hash_size; const char *client_connect_script; const char *client_disconnect_script; const char *learn_address_script; diff --git a/tests/unit_tests/openvpn/test_misc.c b/tests/unit_tests/openvp= n/test_misc.c index 3272f6b..b1e0bef 100644 --- a/tests/unit_tests/openvpn/test_misc.c +++ b/tests/unit_tests/openvpn/test_misc.c @@ -123,7 +123,7 @@ word_hash_function(const void *key, uint32_t iv) { const char *str =3D (const char *) key; - const int len =3D strlen(str); + const uint32_t len =3D (uint32_t)strlen(str); return hash_func((const uint8_t *)str, len, iv); } @@ -133,11 +133,11 @@ return strcmp((const char *)key1, (const char *)key2) =3D=3D 0; } -static unsigned long +static uint32_t get_random(void) { /* rand() is not very random, but it's C99 and this is just for testin= g */ - return rand(); + return (uint32_t)rand(); } static struct hash_element * @@ -172,7 +172,7 @@ struct hash *hash =3D hash_init(10000, get_random(), word_hash_functio= n, word_compare_function); struct hash *nhash =3D hash_init(256, get_random(), word_hash_function= , word_compare_function); - printf("hash_init n_buckets=3D%d mask=3D0x%08x\n", hash->n_buckets, ha= sh->mask); + printf("hash_init n_buckets=3D%u mask=3D0x%08x\n", hash->n_buckets, ha= sh->mask); char wordfile[PATH_MAX] =3D { 0 }; openvpn_test_get_srcdir_dir(wordfile, PATH_MAX, "/../../../COPYRIGHT.G= PL" ); @@ -250,10 +250,10 @@ /* output contents of hash table */ { - ptr_type inc =3D 0; + uint32_t inc =3D 0; int count =3D 0; - for (ptr_type base =3D 0; base < hash_n_buckets(hash); base +=3D i= nc) + for (uint32_t base =3D 0; base < hash_n_buckets(hash); base +=3D i= nc) { struct hash_iterator hi; struct hash_element *he; -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1119?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I3334465738fb1fbf508dfd719b6a238b500cc0ae Gerrit-Change-Number: 1119 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --KjQMGRRQDZA= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

list: Make types of hash elements consistent

Really n= o use in having the indices and limits in int.

Change-Id: I333446573= 8fb1fbf508dfd719b6a238b500cc0ae
Signed-off-by: Frank Lichtenheld <fra= nk@...2641...>
---
M src/openvpn/integer.h
M src/openvpn/list.c=
M src/openvpn/list.h
M src/openvpn/multi.c
M src/openvpn/multi.h<= br>M src/openvpn/options.c
M src/openvpn/options.h
M tests/unit_tests= /openvpn/test_misc.c
8 files changed, 63 insertions(+), 50 deletions(-)<= br>
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/19/1=
119/1
diff --git a/src/openvpn/integer.h b/src/openvpn/integer.h
index c568036..e6106c9 100644
--- a/src/openv= pn/integer.h
+++ b/src/openvpn/integer.h
@@= -132,6 +132,27 @@
}
}

+static inline un= signed int
+constrain= _uint(unsigned int x, unsigned int min, unsigned int max)
+{
+ if (min > max)
+ {
+ return min;
+ }
+ if= (x < min)
+ {<= /span>
+ return min;<= /span>
+ }
+ else if (x > max)
+ {
+ return max;
+ }
+ else
+ {
+ = return x;
+ }
+}
+
/*
= * Functions used for circular buffer index arithmetic.
*/=
diff --git a/src/openvpn/list.c b/src/openvpn/list.c
index 1f33b5f..3971d62 100644
--- a/src/openvpn/= list.c
+++ b/src/openvpn/list.c
@@ -35,23 += 35,22 @@
#include "memdbg.h"

struct hash *
-hash_init(const int n_buckets,
+hash_init(const uint32_t n_buckets,
= const uint32_t iv,
uint32_t (*hash_functi= on)(const void *key, uint32_t iv),
bool (*compar= e_function)(const void *key1, const void *key2))
{<= br> struct hash *h;
- int i;

ASSERT(n_buckets = > 0);
ALLOC_OBJ_CLEAR(h, struct hash);
- h->n_buckets =3D (int) adju= st_power_of_2(n_buckets);

+ h->n_buckets =3D (uint32_t)adjust_power_of_2(n_buckets);
h->mask =3D h->n_buckets - 1;
h-= >hash_function =3D hash_function;
h->compare_fun= ction =3D compare_function;
h->iv =3D iv; ALLOC_ARRAY(h->buckets, struct hash_bucket, h->n_buckets)= ;
- for (i =3D 0; i = < h->n_buckets; ++i)
+ for (uint32_t i =3D 0; i < h->n_buckets; ++i)
{

struct hash_bucket *b =3D &h->bu= ckets[i];
b->list =3D NULL;
@@ = -62,8 +61,7 @@
void
hash_free(struct hash= *hash)
{
- int i;
- fo= r (i =3D 0; i < hash->n_buckets; ++i)
+ for (uint32_t i =3D 0; i < hash->n_bucket= s; ++i)
{
struct hash_bucket = *b =3D &hash->buckets[i];
struct hash_eleme= nt *he =3D b->list;
@@ -222,15 +220,15 @@
void

hash_iterator_init_range(struct hash *hash,=
struct hash_iterator *hi,
- int start_= bucket,

- = int end_bucket)
+ uint32_t start_bucket,
+ uint32_t end_bu= cket)
{
if (end_bucket > hash->= n_buckets)
{
end_bucket =3D h= ash->n_buckets;
}

- ASSERT(start_bucket >=3D 0 &am= p;& start_bucket <=3D end_bucket);

+ ASSERT(start_bucket <=3D end_bucket);
hi->hash =3D hash;
h= i->elem =3D NULL;
@@ -336,6 +334,9 @@
= * the return value. Every 1-bit and 2-bit delta achieves avalanche.=
* About 36+6len instructions.
*
+ * #define hashsize(n) ((uint32_t= )1<<(n))
+ * #d= efine hashmask(n) (hashsize(n)-1)
+ *
* The best hash table sizes are powers o= f 2. There is no need to do
* mod a prime (mod is sooo s= low!). If you need less than 32 bits,
* use a bitmask. = For example, if you need only 10 bits, do
diff --git a/src/= openvpn/list.h b/src/openvpn/list.h
index 783570f..d2c5373 = 100644
--- a/src/openvpn/list.h
+++ b/src/o= penvpn/list.h
@@ -37,14 +37,11 @@
#include= "basic.h"
#include "buffer.h"<= br>
-#define has= hsize(n) ((uint32_t)1<<(n))
-#define hashmask(n) (hashsize(n)-1)
-
struct hash_element
<= span> {
void *value;
const void *= key;
- unsigned int = hash_value;
+ uint= 32_t hash_value;
struct hash_element *next;
= };

@@ -55,16 +52,16 @@
<= span>
struct hash
{
- int n_buckets;
- int n_elements;
- int mask;
+ uint32_t n_buckets;
+ uint32_t n_elements;
+ uint32_t mask;
= uint32_t iv;
uint32_t (*hash_function)(const void *key= , uint32_t iv);
bool (*compare_function)(const void *k= ey1, const void *key2); /* return true if equal */
str= uct hash_bucket *buckets;
};

<= span style=3D"color: hsl(0, 100%, 40%);">-struct hash *hash_init(const int = n_buckets,
+struct ha= sh *hash_init(const uint32_t n_buckets,
= const uint32_t iv,
uint32_t (*= hash_function)(const void *key, uint32_t iv),
= bool (*compare_function)(const void *key1, const void *key2));
@@ -88,19 +85,19 @@
struct hash_iterator
{
struct hash *hash;
- int bucket_index;
+ uint32_t bucket_index;
<= span> struct hash_bucket *bucket;

struct hash_elem= ent *elem;
struct hash_element *last;
= bool bucket_marked;
- int bucket_index_end;
+ uint32_t bucket_index_start;
+ uint32_t bucket_index_end;
= };

void hash_iterator_init_range(struct= hash *hash,
struct hash_ite= rator *hi,
- = int start_bucket,
- int end_bucket);
+ uin= t32_t start_bucket,

+= uint32_t end_bucket);

void hash_iterator_init(struct hash *hash, struct hash_iterator= *iter);

@@ -118,13 +115,13 @@
= return (*hash->hash_function)(key, hash->iv);
}


= +static inline uint32_t
hash_n_elements(const struct hash = *hash)
{
return hash->n_elements;<= /span>
}

-static inline int
+static inline uint32_t
hash_n_buckets(const s= truct hash *hash)
{
return hash->n= _buckets;
diff --git a/src/openvpn/multi.c b/src/openvpn/mu= lti.c
index c0e8f9c..02157ac 100644
--- a/s= rc/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -175,19 +175,13 @@


static void
multi_reap_range(const struct multi_context *m,
- int start_bucket,
- int en= d_bucket)
+ = uint32_t start_bucket,
+ uint32_t end_bucket)
{ struct gc_arena gc =3D gc_new();
struct h= ash_iterator hi;
struct hash_element *he;

- if (start_bu= cket < 0)
- {

- start_bucket =3D = 0;
- end_bucket = =3D hash_n_buckets(m->vhash);
- }
-
dmsg(D_MULTI_DEBUG, "MULTI: REAP range %d -> %d&qu= ot;, start_bucket, end_bucket);
hash_iterator_init_ran= ge(m->vhash, &hi, start_bucket, end_bucket);
wh= ile ((he =3D hash_iterator_next(&hi)) !=3D NULL)
@@ -20= 9,11 +203,11 @@
static void
multi_reap_al= l(const struct multi_context *m)
{
- multi_reap_range(m, -1, 0);
<= span style=3D"color: hsl(120, 100%, 40%);">+ multi_reap_range(m, 0, hash= _n_buckets(m->vhash));

}

static struct multi_reap *
-multi_reap_new(int buckets_per_pass)
+multi_reap_new(uint32_t buckets_per_pass)=
{
struct multi_reap *mr;
= ALLOC_OBJ(mr, struct multi_reap);
@@ -245,10 +239,10 @@<= /span>
/*
* How many buckets in vhash to reap p= er pass.
*/
-static int
-rea= p_buckets_per_pass(int n_buckets)
+static uint32_t
+reap_buckets_per_pass(uint32_t n_buckets)
{
- return constrain_int(n= _buckets / REAP_DIVISOR, REAP_MIN, REAP_MAX);
+ return constrain_uint(n_buckets / REAP_DIVISO= R, REAP_MIN, REAP_MAX);
}

#ifdef ENABLE_MANAGEMENT

diff --git a/src/openvpn/multi.= h b/src/openvpn/multi.h
index 3c821d7..a622e8c 100644
--- a/src/openvpn/multi.h
+++ b/src/openvpn/mult= i.h
@@ -52,8 +52,8 @@
*/
= struct multi_reap
{
- int bucket_base;
- int buckets_per_pass;
+ uint32_t bucket_base;
+ uint32_t buckets_per_pass;
= time_t last_call;
};

diff --git a/src/openvpn/options.c b/src/openvpn/options.c

index d3ca340..9ca2c4a 100644

--- a/src/openvpn/options.c<= /span>
+++ b/src/openvpn/options.c
@@ -7588,11 +75= 88,11 @@
}
else if (streq(p[0], &= quot;hash-size") && p[1] && p[2] && !p[3])
{
- = int real, virtual;
+ uint32_t real, virtual;

= VERIFY_PERMISSION(OPT_P_GENERAL);
- real =3D atoi_warn(p[1], msglevel);
- virtual =3D atoi_warn(p[2], = msglevel);

+ r= eal =3D positive_atoi(p[1], msglevel);
+ virtual =3D positive_atoi(p[2], msglevel);
if (real < 1 || virtual < 1)
= {
msg(msglevel, "--hash-size sizes m= ust be >=3D 1 (preferably a power of 2)");
diff --g= it a/src/openvpn/options.h b/src/openvpn/options.h
index 78= b0d7c..9542d93 100644
--- a/src/openvpn/options.h+++ b/src/openvpn/options.h
@@ -498,8 +498,8 @@
struct in6_addr ifconfig_ipv6_pool_base; /* IPv= 6 */
int ifconfig_ipv6_pool_netbits; = /* IPv6 */

- int real_hash_size;
- int virtual_hash_size;
+ uint32_t real_hash_size;
+ uint32_t virtual_hash_size;
const char *client_connect_script;

const char *c= lient_disconnect_script;
const char *learn_address_scr= ipt;
diff --git a/tests/unit_tests/openvpn/test_misc.c b/te= sts/unit_tests/openvpn/test_misc.c
index 3272f6b..b1e0bef 1= 00644
--- a/tests/unit_tests/openvpn/test_misc.c
= +++ b/tests/unit_tests/openvpn/test_misc.c
@@ -123,7 = +123,7 @@
word_hash_function(const void *key, uint32_t iv)=
{
const char *str =3D (const char *)= key;
- const int le= n =3D strlen(str);
+ = const uint32_t len =3D (uint32_t)strlen(str);
retur= n hash_func((const uint8_t *)str, len, iv);
}

@@ -133,11 +133,11 @@
return str= cmp((const char *)key1, (const char *)key2) =3D=3D 0;
}


-static= unsigned long
+stati= c uint32_t
get_random(void)
{
<= span> /* rand() is not very random, but it's C99 and this is just f= or testing */
- retu= rn rand();
+ retur= n (uint32_t)rand();
}

s= tatic struct hash_element *
@@ -172,7 +172,7 @@
<= span> struct hash *hash =3D hash_init(10000, get_random(), word_hash_fu= nction, word_compare_function);
struct hash *nhash =3D= hash_init(256, get_random(), word_hash_function, word_compare_function);

- p= rintf("hash_init n_buckets=3D%d mask=3D0x%08x\n", hash->n_buck= ets, hash->mask);
= + printf("hash_init n_buckets=3D%u mask=3D0x%08x\n", hash->= n_buckets, hash->mask);

char word= file[PATH_MAX] =3D { 0 };
openvpn_test_get_srcdir_dir(= wordfile, PATH_MAX, "/../../../COPYRIGHT.GPL" );
= @@ -250,10 +250,10 @@

/* output cont= ents of hash table */
{
- ptr_type inc =3D 0;
+ uint32_t inc =3D 0;
= int count =3D 0;

- for (ptr_type base =3D 0; base < hash_n_bu= ckets(hash); base +=3D inc)
+ for (uint32_t base =3D 0; base < hash_n_buckets(hash); b= ase +=3D inc)
{
struc= t hash_iterator hi;
struct hash_element *he;

To view, visit change 1119. To unsubscribe, = or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I3334465738fb1fbf508dfd719b6= a238b500cc0ae
Gerrit-Change-Number: 1119
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--KjQMGRRQDZA=--