aboutsummaryrefslogtreecommitdiff
path: root/multi.c
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-11-18 22:17:58 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-11-18 22:17:58 +0100
commit529df9922d85574828d95020eebcd228ba3a8164 (patch)
tree8524b46dd4bbbd163d4ce273ea6e82edd7c4b947 /multi.c
parentMerge branch 'bugfix2.1' into beta2.2 (diff)
parentMerged add_bypass_address() and add_host_route_if_nonlocal() (diff)
downloadopenvpn-529df9922d85574828d95020eebcd228ba3a8164.tar.xz
Merge branch 'feat_misc' into beta2.2
Conflicts: acinclude.m4 config-win32.h configure.ac misc.c thread.c thread.h - These conflicts was mainly due to feat_misc getting old and mostly caused by the pthread clean-up patches in feat_misc Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
Diffstat (limited to 'multi.c')
-rw-r--r--multi.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/multi.c b/multi.c
index 57310f6..22c0a3f 100644
--- a/multi.c
+++ b/multi.c
@@ -146,7 +146,7 @@ multi_reap_range (const struct multi_context *m,
}
dmsg (D_MULTI_DEBUG, "MULTI: REAP range %d -> %d", start_bucket, end_bucket);
- hash_iterator_init_range (m->vhash, &hi, true, start_bucket, end_bucket);
+ hash_iterator_init_range (m->vhash, &hi, start_bucket, end_bucket);
while ((he = hash_iterator_next (&hi)) != NULL)
{
struct multi_route *r = (struct multi_route *) he->value;
@@ -587,7 +587,7 @@ multi_uninit (struct multi_context *m)
struct hash_iterator hi;
struct hash_element *he;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
@@ -633,7 +633,6 @@ multi_create_instance (struct multi_context *m, const struct mroute_addr *real)
ALLOC_OBJ_CLEAR (mi, struct multi_instance);
- mutex_init (&mi->mutex);
mi->gc = gc_new ();
multi_instance_inc_refcount (mi);
mi->vaddr_handle = -1;
@@ -724,7 +723,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
status_printf (so, "OpenVPN CLIENT LIST");
status_printf (so, "Updated,%s", time_string (0, 0, false, &gc_top));
status_printf (so, "Common Name,Real Address,Bytes Received,Bytes Sent,Connected Since");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -745,7 +744,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
status_printf (so, "ROUTING TABLE");
status_printf (so, "Virtual Address,Common Name,Real Address,Last Ref");
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -788,7 +787,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
status_printf (so, "TIME%c%s%c%u", sep, time_string (now, 0, false, &gc_top), sep, (unsigned int)now);
status_printf (so, "HEADER%cCLIENT_LIST%cCommon Name%cReal Address%cVirtual Address%cBytes Received%cBytes Sent%cConnected Since%cConnected Since (time_t)",
sep, sep, sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -811,7 +810,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
status_printf (so, "HEADER%cROUTING_TABLE%cVirtual Address%cCommon Name%cReal Address%cLast Ref%cLast Ref (time_t)",
sep, sep, sep, sep, sep, sep);
- hash_iterator_init (m->vhash, &hi, true);
+ hash_iterator_init (m->vhash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -850,7 +849,7 @@ multi_print_status (struct multi_context *m, struct status_output *so, const int
#ifdef PACKET_TRUNCATION_CHECK
{
status_printf (so, "HEADER,ERRORS,Common Name,TUN Read Trunc,TUN Write Trunc,Pre-encrypt Trunc,Post-decrypt Trunc");
- hash_iterator_init (m->hash, &hi, true);
+ hash_iterator_init (m->hash, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct gc_arena gc = gc_new ();
@@ -896,8 +895,6 @@ multi_learn_addr (struct multi_context *m,
struct multi_route *oldroute = NULL;
struct multi_instance *owner = NULL;
- hash_bucket_lock (bucket);
-
/* if route currently exists, get the instance which owns it */
he = hash_lookup_fast (m->vhash, bucket, addr, hv);
if (he)
@@ -967,7 +964,6 @@ multi_learn_addr (struct multi_context *m,
gc_free (&gc);
}
- hash_bucket_unlock (bucket);
return owner;
}
@@ -1001,8 +997,6 @@ multi_get_instance_by_virtual_addr (struct multi_context *m,
struct mroute_addr tryaddr;
int i;
- mroute_helper_lock (rh);
-
/* cycle through each CIDR length */
for (i = 0; i < rh->n_net_len; ++i)
{
@@ -1023,8 +1017,6 @@ multi_get_instance_by_virtual_addr (struct multi_context *m,
break;
}
}
-
- mroute_helper_unlock (rh);
}
#ifdef ENABLE_DEBUG
@@ -1135,7 +1127,7 @@ multi_delete_dup (struct multi_context *m, struct multi_instance *new_mi)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
@@ -1781,7 +1773,7 @@ multi_bcast (struct multi_context *m,
printf ("BCAST len=%d\n", BLEN (buf));
#endif
mb = mbuf_alloc_buf (buf);
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
@@ -2249,7 +2241,7 @@ multi_get_queue (struct mbuf_set *ms)
{
struct mbuf_item item;
- if (mbuf_extract_item (ms, &item, true)) /* cleartext IP packet */
+ if (mbuf_extract_item (ms, &item)) /* cleartext IP packet */
{
unsigned int pipv4_flags = PIPV4_PASSTOS;
@@ -2475,7 +2467,7 @@ management_callback_kill_by_cn (void *arg, const char *del_cn)
struct hash_element *he;
int count = 0;
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;
@@ -2509,7 +2501,7 @@ management_callback_kill_by_addr (void *arg, const in_addr_t addr, const int por
saddr.sa.sin_port = htons (port);
if (mroute_extract_openvpn_sockaddr (&maddr, &saddr, true))
{
- hash_iterator_init (m->iter, &hi, true);
+ hash_iterator_init (m->iter, &hi);
while ((he = hash_iterator_next (&hi)))
{
struct multi_instance *mi = (struct multi_instance *) he->value;