git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@991 e7ae566f-a301-0410-adde-c780ea21d3b5
james authored on 2006/04/05 16:30:04... | ... |
@@ -936,6 +936,8 @@ delete_route (const struct route *r, const struct tuntap *tt, unsigned int flags |
936 | 936 |
network, |
937 | 937 |
netmask); |
938 | 938 |
#endif /*CONFIG_FEATURE_IPROUTE*/ |
939 |
+ if (r->metric_defined) |
|
940 |
+ buf_printf (&buf, " metric %d", r->metric); |
|
939 | 941 |
msg (D_ROUTE, "%s", BSTR (&buf)); |
940 | 942 |
system_check (BSTR (&buf), es, 0, "ERROR: Linux route delete command failed"); |
941 | 943 |
|
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
#! /bin/sh |
2 | 2 |
# |
3 | 3 |
# t_cltsrv.sh - script to test OpenVPN's crypto loopback |
4 |
-# Copyright (C) 2005 Matthias Andree |
|
4 |
+# Copyright (C) 2005,2006 Matthias Andree |
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or |
7 | 7 |
# modify it under the terms of the GNU General Public License |
... | ... |
@@ -19,7 +19,6 @@ |
19 | 19 |
# 02110-1301, USA. |
20 | 20 |
|
21 | 21 |
set -e |
22 |
-echo "the following test will run about two minutes..." >&2 |
|
23 | 22 |
trap "rm -f log.$$ log.$$.signal ; trap 0 ; exit 77" 1 2 15 |
24 | 23 |
trap "rm -f log.$$ log.$$.signal ; exit 1" 0 3 |
25 | 24 |
addopts= |
... | ... |
@@ -27,11 +26,19 @@ case `uname -s` in |
27 | 27 |
FreeBSD) |
28 | 28 |
# FreeBSD jails map the outgoing IP to the jail IP - we need to |
29 | 29 |
# allow the real IP unless we want the test to run forever. |
30 |
- if test `sysctl -n security.jail.jailed` != 0 ; then |
|
30 |
+ if test "`sysctl 2>/dev/null -n security.jail.jailed`" = 1 \ |
|
31 |
+ || ps -ostate= -p $$ | grep -q J; then |
|
31 | 32 |
addopts="--float" |
33 |
+ if test "x`ifconfig | grep inet`" = x ; then |
|
34 |
+ echo "###" |
|
35 |
+ echo "### To run the test in a FreeBSD jail, you MUST add an IP alias for the jail's IP." |
|
36 |
+ echo "###" |
|
37 |
+ exit 1 |
|
38 |
+ fi |
|
32 | 39 |
fi |
33 | 40 |
;; |
34 | 41 |
esac |
42 |
+echo "the following test will take about two minutes..." >&2 |
|
35 | 43 |
set +e |
36 | 44 |
( |
37 | 45 |
./openvpn --cd "${srcdir}" ${addopts} --down 'echo "srv:${signal}" >&3 ; : #' --tls-exit --ping-exit 180 --config sample-config-files/loopback-server & |
... | ... |
@@ -720,7 +720,19 @@ do_ifconfig (struct tuntap *tt, |
720 | 720 |
tun_mtu |
721 | 721 |
); |
722 | 722 |
else |
723 |
- no_tap_ifconfig (); |
|
723 |
+ /* |
|
724 |
+ * NetBSD has distinct tun and tap devices |
|
725 |
+ * so we don't need the "link0" extra parameter to specify we want to do |
|
726 |
+ * tunneling at the ethernet level |
|
727 |
+ */ |
|
728 |
+ openvpn_snprintf (command_line, sizeof (command_line), |
|
729 |
+ IFCONFIG_PATH " %s %s netmask %s mtu %d broadcast %s", |
|
730 |
+ actual, |
|
731 |
+ ifconfig_local, |
|
732 |
+ ifconfig_remote_netmask, |
|
733 |
+ tun_mtu, |
|
734 |
+ ifconfig_broadcast |
|
735 |
+ ); |
|
724 | 736 |
msg (M_INFO, "%s", command_line); |
725 | 737 |
system_check (command_line, es, S_FATAL, "NetBSD ifconfig failed"); |
726 | 738 |
tt->did_ifconfig = true; |