summaryrefslogtreecommitdiffstats
path: root/route.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 /route.c
parenteb208d36d466a1725e20e0a7aef39b1114b99e78 (diff)
parent7c18c6353904f8c6e7f4eab3d13c985761ab80e5 (diff)
downloadopenvpn-529df9922d85574828d95020eebcd228ba3a8164.tar.gz
openvpn-529df9922d85574828d95020eebcd228ba3a8164.tar.xz
openvpn-529df9922d85574828d95020eebcd228ba3a8164.zip
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 'route.c')
-rw-r--r--route.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/route.c b/route.c
index c63eb41..b5092fe 100644
--- a/route.c
+++ b/route.c
@@ -59,26 +59,6 @@ print_bypass_addresses (const struct route_bypass *rb)
#endif
-static bool
-add_bypass_address (struct route_bypass *rb, const in_addr_t a)
-{
- int i;
- for (i = 0; i < rb->n_bypass; ++i)
- {
- if (a == rb->bypass[i]) /* avoid duplicates */
- return true;
- }
- if (rb->n_bypass < N_ROUTE_BYPASS)
- {
- rb->bypass[rb->n_bypass++] = a;
- return true;
- }
- else
- {
- return false;
- }
-}
-
struct route_option_list *
new_route_option_list (const int max_routes, struct gc_arena *a)
{
@@ -2153,8 +2133,18 @@ netmask_to_netbits (const in_addr_t network, const in_addr_t netmask, int *netbi
static void
add_host_route_if_nonlocal (struct route_bypass *rb, const in_addr_t addr)
{
- if (test_local_addr(addr) == TLA_NONLOCAL && addr != 0 && addr != ~0)
- add_bypass_address (rb, addr);
+ if (test_local_addr(addr) == TLA_NONLOCAL && addr != 0 && addr != ~0) {
+ int i;
+ for (i = 0; i < rb->n_bypass; ++i)
+ {
+ if (addr == rb->bypass[i]) /* avoid duplicates */
+ return;
+ }
+ if (rb->n_bypass < N_ROUTE_BYPASS)
+ {
+ rb->bypass[rb->n_bypass++] = addr;
+ }
+ }
}
static void