summaryrefslogtreecommitdiff
path: root/net/vpnc/patches
diff options
context:
space:
mode:
authorhubertf <hubertf@pkgsrc.org>2006-01-03 21:48:09 +0000
committerhubertf <hubertf@pkgsrc.org>2006-01-03 21:48:09 +0000
commit4e3b054b94a66267b6a9efc1258414f2a413dc0e (patch)
tree34343b36332d6305abdce40b9fb406fb74fc564b /net/vpnc/patches
parent07d9a333bb103844be347a16f6cc9f16d05e4749 (diff)
downloadpkgsrc-4e3b054b94a66267b6a9efc1258414f2a413dc0e.tar.gz
Update vpnc to 0.3.3. Changes:
* ignore \r in config files * (hopefuly) fixed 64bit bugs (Nicolas Boichat and Zach Brown) * added support for "Split-Net" Routing * introduced vpnc-script and removed vpnc-connect * always search for configfiles in /etc/vpnc/ expect if the filename contains at least one "/" * only read /etc/vpnc/default.conf and /etc/vpnc.conf if no other configfiles are provided * various other fixes contributed by Anton Altaparmakov, Randy Chou, "krabat", Andre Vanha and Nikolay Sturm
Diffstat (limited to 'net/vpnc/patches')
-rw-r--r--net/vpnc/patches/patch-aa36
-rw-r--r--net/vpnc/patches/patch-ac109
2 files changed, 136 insertions, 9 deletions
diff --git a/net/vpnc/patches/patch-aa b/net/vpnc/patches/patch-aa
index 30bebfe7932..8a6172d02be 100644
--- a/net/vpnc/patches/patch-aa
+++ b/net/vpnc/patches/patch-aa
@@ -1,15 +1,33 @@
-$NetBSD: patch-aa,v 1.2 2004/11/26 23:03:54 hubertf Exp $
+$NetBSD: patch-aa,v 1.3 2006/01/03 21:48:17 hubertf Exp $
---- config.c.orig 2004-11-22 01:11:48.000000000 +0100
+--- config.c.orig 2005-05-01 16:06:36.000000000 -0400
+++ config.c
-@@ -484,8 +484,8 @@ void do_config(int argc, char **argv)
- }
+@@ -125,7 +125,7 @@ static const char *config_def_app_versio
+
+ static const char *config_def_script(void)
+ {
+- return "/etc/vpnc/vpnc-script";
++ return PKG_SYSCONFDIR "/vpnc-script";
+ }
+
+ static const char *config_def_pid_file(void)
+@@ -325,7 +325,7 @@ static void read_config_file(const char
+ if (index(name, '/'))
+ realname = strdup(name);
+ else
+- asprintf(&realname, "/etc/vpnc/%s", name);
++ asprintf(&realname, PKG_SYSCONFDIR "/vpnc/%s", name);
+ f = fopen(realname, "r");
+ if (missingok && f == NULL && errno == ENOENT) {
+ free(realname);
+@@ -520,8 +520,8 @@ void do_config(int argc, char **argv)
}
-- read_config_file("/etc/vpnc/default.conf", config, 1);
-- read_config_file("/etc/vpnc.conf", config, 1);
-+ read_config_file(PKG_SYSCONFDIR "/vpnc/default.conf", config, 1);
-+ read_config_file(PKG_SYSCONFDIR "/vpnc.conf", config, 1);
+ if (!got_conffile) {
+- read_config_file("/etc/vpnc/default.conf", config, 1);
+- read_config_file("/etc/vpnc.conf", config, 1);
++ read_config_file(PKG_SYSCONFDIR "/vpnc/default.conf", config, 1);
++ read_config_file(PKG_SYSCONFDIR "/vpnc.conf", config, 1);
+ }
if (!print_config) {
- for (i = 0; config_names[i].name != NULL; i++)
diff --git a/net/vpnc/patches/patch-ac b/net/vpnc/patches/patch-ac
new file mode 100644
index 00000000000..3f04ffdff11
--- /dev/null
+++ b/net/vpnc/patches/patch-ac
@@ -0,0 +1,109 @@
+$NetBSD: patch-ac,v 1.1 2006/01/03 21:48:17 hubertf Exp $
+
+--- vpnc-script.orig 2006-01-03 22:36:27.000000000 +0100
++++ vpnc-script
+@@ -19,10 +19,12 @@
+ #set -x
+
+ OS="`uname -s`"
+-DEFAULT_ROUTE_FILE=/var/run/vpnc/defaultroute
+-RESOLV_CONF_BACKUP=/var/run/vpnc/resolv.conf-backup
++STATEDIR=/var/run/vpnc
++DEFAULT_ROUTE_FILE=$STATEDIR/defaultroute
++RESOLV_CONF_BACKUP=$STATEDIR/resolv.conf-backup
+
+-IPROUTE="`which ip 2> /dev/null`"
++# stupid SunOS: no blubber in /usr/local/bin ... (on stdout)
++IPROUTE="`which ip | grep '^/' 2> /dev/null`"
+
+ if [ "$OS" = "Linux" ]; then
+ ifconfig_syntax_ptp="pointopoint"
+@@ -56,7 +58,9 @@ do_pre_init() {
+ fi
+ fi
+ elif [ "$OS" = "FreeBSD" ]; then
+- :
++ if [ ! -e /dev/tun ]; then
++ kldload if_tun
++ fi
+ elif [ "$OS" = "NetBSD" ]; then
+ :
+ elif [ "$OS" = "OpenBSD" ]; then
+@@ -64,6 +68,8 @@ do_pre_init() {
+ elif [ "$OS" = "SunOS" ]; then
+ :
+ fi
++
++ mkdir -p $STATEDIR
+ }
+
+ do_ifconfig() {
+@@ -72,7 +78,7 @@ do_ifconfig() {
+
+ if [ -n "$IPROUTE" ]; then
+ fix_ip_get_output () {
+- sed 's/cache//;s/metric[0-9]\+ [0-9]\+//g'
++ sed 's/cache//;s/metric \?[0-9]\+ [0-9]\+//g'
+ }
+
+ set_vpngateway_route() {
+@@ -117,7 +123,10 @@ if [ -n "$IPROUTE" ]; then
+ }
+ else
+ get_default_gw() {
+- netstat -r -n | grep '^0.0.0.0' | awk '{print $2}'
++ # Let's assume the first default gateway is IPv4...
++ # (On NetBSD '-f inet' and on Linux and probably Solaris,
++ # '-A inet' could be used to make sure... - HF)
++ netstat -rn | awk '/^(default|0.0.0.0)/{ print $2 ; exit } '
+ }
+
+ set_vpngateway_route() {
+@@ -131,7 +140,7 @@ else
+ set_default_route() {
+ DEFAULTGW="`get_default_gw`"
+ echo "$DEFAULTGW" > "$DEFAULT_ROUTE_FILE"
+- route $route_syntax_del default
++ route $route_syntax_del default "$DEFAULTGW"
+ route add default $route_syntax_gw "$INTERNAL_IP4_ADDRESS"
+ }
+
+@@ -219,11 +228,13 @@ do_connect() {
+ do_ifconfig
+ set_vpngateway_route
+ if [ -n "$CISCO_SPLIT_INC" ]; then
+- for ((i = 0 ; i < CISCO_SPLIT_INC ; i++ )) ; do
++ i=0
++ while [ $i -lt $CISCO_SPLIT_INC ] ; do
+ eval NETWORK="\${CISCO_SPLIT_INC_${i}_ADDR}"
+ eval NETMASK="\${CISCO_SPLIT_INC_${i}_MASK}"
+ eval NETMASKLEN="\${CISCO_SPLIT_INC_${i}_MASKLEN}"
+ set_network_route "$NETWORK" "$NETMASK" "$NETMASKLEN"
++ i=`expr $i + 1`
+ done
+ for i in $INTERNAL_IP4_DNS ; do
+ set_network_route "$i" "255.255.255.255" "32"
+@@ -239,11 +250,13 @@ do_connect() {
+
+ do_disconnect() {
+ if [ -n "$CISCO_SPLIT_INC" ]; then
+- for ((i = 0 ; i < CISCO_SPLIT_INC ; i++ )) ; do
++ i=0
++ while [ $i -lt $CISCO_SPLIT_INC ] ; do
+ eval NETWORK="\${CISCO_SPLIT_INC_${i}_ADDR}"
+ eval NETMASK="\${CISCO_SPLIT_INC_${i}_MASK}"
+ eval NETMASKLEN="\${CISCO_SPLIT_INC_${i}_MASKLEN}"
+ del_network_route "$NETWORK" "$NETMASK" "$NETMASKLEN"
++ i=`expr $i + 1`
+ done
+ for i in $INTERNAL_IP4_DNS ; do
+ del_network_route "$i" "255.255.255.255" "32"
+@@ -260,6 +273,8 @@ do_disconnect() {
+ if [ -n "$INTERNAL_IP4_DNS" ]; then
+ reset_resolvconf
+ fi
++
++ rm -fr -- $STATEDIR
+ }
+
+ ####