#endif
check_malloc_return (e);
ret = (char *) e + sizeof (struct gc_entry);
- /*mutex_lock_static (L_GC_MALLOC);*/
e->next = a->list;
a->list = e;
- /*mutex_unlock_static (L_GC_MALLOC);*/
}
else
{
x_gc_free (struct gc_arena *a)
{
struct gc_entry *e;
- /*mutex_lock_static (L_GC_MALLOC);*/
e = a->list;
a->list = NULL;
- /*mutex_unlock_static (L_GC_MALLOC);*/
while (e != NULL)
{
*/
if (c->c2.tls_multi)
{
- /*tls_mutex_lock (c->c2.tls_multi);*/
tls_pre_encrypt (c->c2.tls_multi, &c->c2.buf, &c->c2.crypto_options);
}
#endif
if (c->c2.tls_multi)
{
tls_post_encrypt (c->c2.tls_multi, &c->c2.buf);
- /*tls_mutex_unlock (c->c2.tls_multi);*/
}
#endif
#endif
* will load crypto_options with the correct encryption key
* and return false.
*/
- /*tls_mutex_lock (c->c2.tls_multi);*/
if (tls_pre_decrypt (c->c2.tls_multi, &c->c2.from, &c->c2.buf, &c->c2.crypto_options))
{
interval_action (&c->c2.tmp_int);
/* authenticate and decrypt the incoming packet */
decrypt_status = openvpn_decrypt (&c->c2.buf, c->c2.buffers->decrypt_buf, &c->c2.crypto_options, &c->c2.frame);
-#ifdef USE_SSL
- if (c->c2.tls_multi)
- {
- /*tls_mutex_unlock (c->c2.tls_multi);*/
- }
-#endif
-
if (!decrypt_status && link_socket_connection_oriented (c->c2.link_socket))
{
/* decryption errors are fatal in TCP mode */
if (ms->len == ms->capacity)
{
struct mbuf_item rm;
- ASSERT (mbuf_extract_item (ms, &rm, false));
+ ASSERT (mbuf_extract_item (ms, &rm));
mbuf_free_buf (rm.buffer);
msg (D_MULTI_DROPPED, "MBUF: mbuf packet dropped");
}
}
bool
-mbuf_extract_item (struct mbuf_set *ms, struct mbuf_item *item, const bool lock)
+mbuf_extract_item (struct mbuf_set *ms, struct mbuf_item *item)
{
bool ret = false;
if (ms)
void mbuf_add_item (struct mbuf_set *ms, const struct mbuf_item *item);
-bool mbuf_extract_item (struct mbuf_set *ms, struct mbuf_item *item, const bool lock);
+bool mbuf_extract_item (struct mbuf_set *ms, struct mbuf_item *item);
void mbuf_dereference_instance (struct mbuf_set *ms, struct multi_instance *mi);
{
struct mroute_helper *mh;
ALLOC_OBJ_CLEAR (mh, struct mroute_helper);
- /*mutex_init (&mh->mutex);*/
mh->ageable_ttl_secs = ageable_ttl_secs;
return mh;
}
if (ir->netbits >= 0)
{
ASSERT (ir->netbits < MR_HELPER_NET_LEN);
- mroute_helper_lock (mh);
++mh->cache_generation;
++mh->net_len_refcount[ir->netbits];
if (mh->net_len_refcount[ir->netbits] == 1)
mroute_helper_regenerate (mh);
- mroute_helper_unlock (mh);
}
}
if (ir->netbits >= 0)
{
ASSERT (ir->netbits < MR_HELPER_NET_LEN);
- mroute_helper_lock (mh);
++mh->cache_generation;
--mh->net_len_refcount[ir->netbits];
ASSERT (mh->net_len_refcount[ir->netbits] >= 0);
if (!mh->net_len_refcount[ir->netbits])
mroute_helper_regenerate (mh);
- mroute_helper_unlock (mh);
}
}
void
mroute_helper_free (struct mroute_helper *mh)
{
- /*mutex_destroy (&mh->mutex);*/
free (mh);
}
* Used to help maintain CIDR routing table.
*/
struct mroute_helper {
- /*MUTEX_DEFINE (mutex);*/
unsigned int cache_generation; /* incremented when route added */
int ageable_ttl_secs; /* host route cache entry time-to-live*/
int n_net_len; /* length of net_len array */
return ret;
}
-static inline void
-mroute_helper_lock (struct mroute_helper *mh)
-{
- /*mutex_lock (&mh->mutex);*/
-}
-
-static inline void
-mroute_helper_unlock (struct mroute_helper *mh)
-{
- /*mutex_unlock (&mh->mutex);*/
-}
-
static inline bool
mroute_addr_equal (const struct mroute_addr *a1, const struct mroute_addr *a2)
{
ASSERT (mi);
/* extract from queue */
- if (mbuf_extract_item (mi->tcp_link_out_deferred, &item, true)) /* ciphertext IP packet */
+ if (mbuf_extract_item (mi->tcp_link_out_deferred, &item)) /* ciphertext IP packet */
{
dmsg (D_MULTI_TCP, "MULTI TCP: transmitting previously deferred packet");
struct mroute_addr tryaddr;
int i;
- mroute_helper_lock (rh);
-
/* cycle through each CIDR length */
for (i = 0; i < rh->n_net_len; ++i)
{
break;
}
}
-
- mroute_helper_unlock (rh);
}
#ifdef ENABLE_DEBUG
{
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;
/* true on initial VPN iteration */
bool first_time;
- /* used by multi-client code to lock the context */
- /*MUTEX_DEFINE (mutex);*/
-
/* context modes */
# define CM_P2P 0 /* standalone point-to-point session or client */
# define CM_TOP 1 /* top level of a multi-client or point-to-multipoint server */
msg (D_TLS_DEBUG_LOW, "TLS: tls_process: killed expiring key");
}
- /*mutex_cycle (multi->mutex);*/
-
do
{
update_time ();
}
}
}
- /*mutex_cycle (multi->mutex);*/
}
while (state_change);
reset_session (multi, session);
}
}
- /*mutex_cycle (multi->mutex);*/
}
update_time ();
*/
struct tls_multi
{
- /* used to coordinate access between main thread and TLS thread */
- /*MUTEX_PTR_DEFINE (mutex);*/
-
/* const options and config info */
struct tls_options opt;