summaryrefslogtreecommitdiff
path: root/src/openvpn/multi.c
diff options
context:
space:
mode:
authorBernhard Schmidt <berni@debian.org>2018-03-04 22:22:32 +0100
committerBernhard Schmidt <berni@debian.org>2018-03-04 22:22:32 +0100
commitcf55ab99392458e723c7ebcc32c19bbd225b1f4b (patch)
treeb895b41b7629c9a31de5cc15e7aa7805ddac87ce /src/openvpn/multi.c
parent9683f890944ffb114f5f8214f694e0b339cf5a5a (diff)
New upstream version 2.4.5
Diffstat (limited to 'src/openvpn/multi.c')
-rw-r--r--src/openvpn/multi.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c
index 8d3d67f..28c3b88 100644
--- a/src/openvpn/multi.c
+++ b/src/openvpn/multi.c
@@ -5,7 +5,7 @@
* packet encryption, packet authentication, and
* packet compression.
*
- * Copyright (C) 2002-2017 OpenVPN Technologies, Inc. <sales@openvpn.net>
+ * Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
@@ -485,7 +485,7 @@ multi_instance_string(const struct multi_instance *mi, bool null, struct gc_aren
}
}
-void
+static void
generate_prefix(struct multi_instance *mi)
{
struct gc_arena gc = gc_new();
@@ -1077,6 +1077,7 @@ multi_learn_addr(struct multi_context *m,
struct hash_bucket *bucket = hash_bucket(m->vhash, hv);
struct multi_route *oldroute = NULL;
struct multi_instance *owner = NULL;
+ struct gc_arena gc = gc_new();
/* if route currently exists, get the instance which owns it */
he = hash_lookup_fast(m->vhash, bucket, addr, hv);
@@ -1090,11 +1091,9 @@ multi_learn_addr(struct multi_context *m,
}
/* do we need to add address to hash table? */
- if ((!owner || owner != mi)
- && mroute_learnable_address(addr)
+ if ((!owner || owner != mi) && mroute_learnable_address(addr, &gc)
&& !mroute_addr_equal(addr, &m->local))
{
- struct gc_arena gc = gc_new();
struct multi_route *newroute;
bool learn_succeeded = false;
@@ -1151,9 +1150,8 @@ multi_learn_addr(struct multi_context *m,
{
free(newroute);
}
-
- gc_free(&gc);
}
+ gc_free(&gc);
return owner;
}
@@ -2355,7 +2353,7 @@ multi_process_post(struct multi_context *m, struct multi_instance *mi, const uns
}
else
{
- msg(M_NONFATAL, "MULTI: inotify_add_watch error: %s", strerror(errno));
+ msg(M_NONFATAL | M_ERRNO, "MULTI: inotify_add_watch error");
}
}
#endif
@@ -2967,7 +2965,7 @@ gremlin_flood_clients(struct multi_context *m)
}
#endif /* ifdef ENABLE_DEBUG */
-bool
+static bool
stale_route_check_trigger(struct multi_context *m)
{
struct timeval null;