mirror of
https://github.com/OpenVPN/openvpn.git
synced 2025-05-31 05:11:33 +08:00
svn merge -r 886:987 $SO/trunk/openvpn .
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@991 e7ae566f-a301-0410-adde-c780ea21d3b5
This commit is contained in:
parent
18597b93f7
commit
55ff44b4ef
2
route.c
2
route.c
@ -936,6 +936,8 @@ delete_route (const struct route *r, const struct tuntap *tt, unsigned int flags
|
|||||||
network,
|
network,
|
||||||
netmask);
|
netmask);
|
||||||
#endif /*CONFIG_FEATURE_IPROUTE*/
|
#endif /*CONFIG_FEATURE_IPROUTE*/
|
||||||
|
if (r->metric_defined)
|
||||||
|
buf_printf (&buf, " metric %d", r->metric);
|
||||||
msg (D_ROUTE, "%s", BSTR (&buf));
|
msg (D_ROUTE, "%s", BSTR (&buf));
|
||||||
system_check (BSTR (&buf), es, 0, "ERROR: Linux route delete command failed");
|
system_check (BSTR (&buf), es, 0, "ERROR: Linux route delete command failed");
|
||||||
|
|
||||||
|
13
t_cltsrv.sh
13
t_cltsrv.sh
@ -1,7 +1,7 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
#
|
#
|
||||||
# t_cltsrv.sh - script to test OpenVPN's crypto loopback
|
# t_cltsrv.sh - script to test OpenVPN's crypto loopback
|
||||||
# Copyright (C) 2005 Matthias Andree
|
# Copyright (C) 2005,2006 Matthias Andree
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -19,7 +19,6 @@
|
|||||||
# 02110-1301, USA.
|
# 02110-1301, USA.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
echo "the following test will run about two minutes..." >&2
|
|
||||||
trap "rm -f log.$$ log.$$.signal ; trap 0 ; exit 77" 1 2 15
|
trap "rm -f log.$$ log.$$.signal ; trap 0 ; exit 77" 1 2 15
|
||||||
trap "rm -f log.$$ log.$$.signal ; exit 1" 0 3
|
trap "rm -f log.$$ log.$$.signal ; exit 1" 0 3
|
||||||
addopts=
|
addopts=
|
||||||
@ -27,11 +26,19 @@ case `uname -s` in
|
|||||||
FreeBSD)
|
FreeBSD)
|
||||||
# FreeBSD jails map the outgoing IP to the jail IP - we need to
|
# FreeBSD jails map the outgoing IP to the jail IP - we need to
|
||||||
# allow the real IP unless we want the test to run forever.
|
# allow the real IP unless we want the test to run forever.
|
||||||
if test `sysctl -n security.jail.jailed` != 0 ; then
|
if test "`sysctl 2>/dev/null -n security.jail.jailed`" = 1 \
|
||||||
|
|| ps -ostate= -p $$ | grep -q J; then
|
||||||
addopts="--float"
|
addopts="--float"
|
||||||
|
if test "x`ifconfig | grep inet`" = x ; then
|
||||||
|
echo "###"
|
||||||
|
echo "### To run the test in a FreeBSD jail, you MUST add an IP alias for the jail's IP."
|
||||||
|
echo "###"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
echo "the following test will take about two minutes..." >&2
|
||||||
set +e
|
set +e
|
||||||
(
|
(
|
||||||
./openvpn --cd "${srcdir}" ${addopts} --down 'echo "srv:${signal}" >&3 ; : #' --tls-exit --ping-exit 180 --config sample-config-files/loopback-server &
|
./openvpn --cd "${srcdir}" ${addopts} --down 'echo "srv:${signal}" >&3 ; : #' --tls-exit --ping-exit 180 --config sample-config-files/loopback-server &
|
||||||
|
14
tun.c
14
tun.c
@ -720,7 +720,19 @@ do_ifconfig (struct tuntap *tt,
|
|||||||
tun_mtu
|
tun_mtu
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
no_tap_ifconfig ();
|
/*
|
||||||
|
* NetBSD has distinct tun and tap devices
|
||||||
|
* so we don't need the "link0" extra parameter to specify we want to do
|
||||||
|
* tunneling at the ethernet level
|
||||||
|
*/
|
||||||
|
openvpn_snprintf (command_line, sizeof (command_line),
|
||||||
|
IFCONFIG_PATH " %s %s netmask %s mtu %d broadcast %s",
|
||||||
|
actual,
|
||||||
|
ifconfig_local,
|
||||||
|
ifconfig_remote_netmask,
|
||||||
|
tun_mtu,
|
||||||
|
ifconfig_broadcast
|
||||||
|
);
|
||||||
msg (M_INFO, "%s", command_line);
|
msg (M_INFO, "%s", command_line);
|
||||||
system_check (command_line, es, S_FATAL, "NetBSD ifconfig failed");
|
system_check (command_line, es, S_FATAL, "NetBSD ifconfig failed");
|
||||||
tt->did_ifconfig = true;
|
tt->did_ifconfig = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user