summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorshtrom2008-06-10 04:17:45 +0000
committershtrom2008-06-10 04:17:45 +0000
commit9b9daf8c760fd378fbabed618504a31a84e307e7 (patch)
tree252d87378241853c7afbe5d5a79a57996718b632
parentb0a79c5aee89c20e9934953ffb8f13d4983ba8a7 (diff)
downloadaur-9b9daf8c760fd378fbabed618504a31a84e307e7.tar.gz
[tspc] Merged patch from Debian.
git-svn-id: svn+ssh://scm.narf.ssji.net/svn/archlinux-packages@117 df209809-8e4a-0410-9a64-c169741eb0fc
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD21
-rw-r--r--debian.patch323
-rwxr-xr-xtspc59
4 files changed, 404 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index d9b56ea5923d..acfae0953d7c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -8,9 +8,13 @@ pkgbase = tspc
license = BSD
depends = openssl
source = http://go6.net/4105/file.asp?file_id=150
+ source = debian.patch
source = fix_missing_headers.patch
+ source = tspc
md5sums = 5c5205dc58e82454a5d55a3efb4bf786
- md5sums = 0c7aa95083375dfdfb3cff6772a2987b
+ md5sums = deb1833e122c6ccbc02e04eeec9d200a
+ md5sums = ea98bbce3ba371e45db7b9535e352363
+ md5sums = 2694da554049281765d05104c6f3dfea
pkgname = tspc
diff --git a/PKGBUILD b/PKGBUILD
index 858c3aac2263..05744708e551 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,17 +7,30 @@ pkgrel=1
pkgdesc='Gateway6 client implementation of the Tunnel Setup Protocol from Hexago'
url="http://go6.net/4105/download.asp"
depends=('openssl')
-conflicts=()
-source=('http://go6.net/4105/file.asp?file_id=150' 'fix_missing_headers.patch')
-md5sums=('5c5205dc58e82454a5d55a3efb4bf786' '0c7aa95083375dfdfb3cff6772a2987b')
+source=('http://go6.net/4105/file.asp?file_id=150' 'debian.patch' 'fix_missing_headers.patch' 'tspc')
+md5sums=('5c5205dc58e82454a5d55a3efb4bf786' 'deb1833e122c6ccbc02e04eeec9d200a' 'ea98bbce3ba371e45db7b9535e352363' '2694da554049281765d05104c6f3dfea')
arch=(i686 x86_64)
license=('BSD')
build() {
+ cd $startdir/src/tspc-advanced
+ patch -p1 < $startdir/src/debian.patch
cd $startdir/src
patch -p1 < $startdir/src/fix_missing_headers.patch
+
cd $startdir/src/tspc-advanced
make all target=linux || return 1
install -D bin/gw6c -m 0755 $startdir/pkg/usr/sbin/tspc
- install -D bin/gw6c.conf.sample -m 0600 $startdir/pkg/etc/tspc.conf.sample
+
+ install -D man/man5/gw6c.conf.5 -m 0644 $startdir/pkg/usr/man/man5/tspc.conf.5
+ install -D man/man8/gw6c.8 -m 0644 $startdir/pkg/usr/man/man8/tspc.conf.8
+ sed -i "s/gw6c/tspc/g" \
+ $startdir/pkg/usr/man/{man5/tspc.conf.5,/man8/tspc.conf.8}
+
+ install -D template/linux.sh -m 0755 $startdir/pkg/etc/tspc/linux.sh
+ install -D bin/gw6c.conf.sample -m 0600 \
+ $startdir/pkg/etc/tspc/tspc.conf
+ sed -i -e "s#^gw6_dir=.*#gw6_dir=/usr/sbin\ntsp_dir=/etc/tspc#g" \
+ $startdir/pkg/etc/tspc/tspc.conf
+ install -D $startdir/tspc -m 0755 $startdir/pkg/etc/rc.d/tspc
}
diff --git a/debian.patch b/debian.patch
new file mode 100644
index 000000000000..01309c57be44
--- /dev/null
+++ b/debian.patch
@@ -0,0 +1,323 @@
+-- tspc-2.1.1.orig/src/tsp/tsp_client.c
++++ tspc-2.1.1/src/tsp/tsp_client.c
+@@ -275,7 +275,7 @@
+
+ start_show:
+
+- Display(0, ELInfo, "tspSetupTunnel", "Got tunnel parameters from server, setting up local tunnel");
++ Display(1, ELInfo, "tspSetupTunnel", "Got tunnel parameters from server, setting up local tunnel");
+
+ /* and start the show */
+ ret = tspStartLocal(socket, conf, &t, nt[conf->transport]);
+@@ -337,8 +337,8 @@
+ LogInit("tspc", LogFile);
+
+ Display( 1, ELInfo, "tspMain", "----- TSP Client Version %s Initializing -------------------------", TSP_CLIENT_VERSION);
+- Display( 0, ELInfo, "tspMain", IDENTIFICATION);
+- Display( 0, ELInfo, "tspMain", "Initializing (use -h for help)\n");
++ Display( 1, ELInfo, "tspMain", IDENTIFICATION);
++ Display( 1, ELInfo, "tspMain", "Initializing (use -h for help)\n");
+
+ if((status = tspInitialize(argc, argv, &c)) != 0) { // *** we have no uninitialize
+ if (status == -1) {
+@@ -361,12 +361,12 @@
+
+ /* first try with RUDP */
+ c.transport = NET_TOOLS_T_RUDP;
+- Display( 0, ELInfo, "tspMain", "\nConnecting to server with reliable udp");
++ Display( 1, ELInfo, "tspMain", "\nConnecting to server with reliable udp");
+
+ try_server:
+
+ if (c.transport == NET_TOOLS_T_TCP)
+- Display( 0, ELInfo, "tspMain", "\nConnecting to server with tcp");
++ Display( 1, ELInfo, "tspMain", "\nConnecting to server with tcp");
+
+ Display( 1, ELInfo, "tspMain", "Using TSP protocol version %s",
+ TspProtocolVersionStrings[version_index]);
+--- tspc-2.1.1.orig/src/lib/log.c
++++ tspc-2.1.1/src/lib/log.c
+@@ -193,6 +193,9 @@
+ fflush(Logfp);
+ }
+
++ /* only syslog errors */
++ if (ErrorLevel>ELError) return 0;
++
+ snprintf(str, sizeof str, " %s: %s", FunctionName, fmt);
+
+ SYSLOG(prio[ErrorLevel], str);
+@@ -231,6 +234,9 @@
+ fflush(Logfp);
+ }
+
++ /* only syslog errors */
++ if (ErrorLevel>ELError) return 0;
++
+ snprintf(str, sizeof str, "%s : %s", FunctionName, Format);
+
+ SYSLOG(prio[ErrorLevel], str);
+--- tspc-2.1.1.orig/src/lib/config.c
++++ tspc-2.1.1/src/lib/config.c
+@@ -474,14 +474,17 @@
+ if(IsPresent(Conf->dns_server)) {
+ char *Server;
+ char *dns = strdup(Conf->dns_server);
++ struct addrinfo *contact;
+ if (eq(Conf->host_type, "host")) {
+ Display(1,ELError, "tspVerifyConfig", "DNS delegation is not supported for host_type=host");
+ status = 1;
+ }
+ for(Server = strtok(dns, ":");Server; Server = strtok(NULL, ":")) {
+- if(gethostbyname(Server) == NULL) {
++ if(getaddrinfo(Server, "domain", 0, &contact)!=0) {
+ Display(1,ELError, "tspVerifyConfig", "DNS server name %s is not resolving.", Server);
+ status = 1;
++ } else {
++ freeaddrinfo(contact);
+ }
+ }
+ free(dns);
+-- tspc-2.1.1.orig/platform/linux/tsp_local.c
++++ tspc-2.1.1/platform/linux/tsp_local.c
+@@ -59,13 +59,13 @@
+
+ /* these globals are defined by US used by alot of things in */
+
+-char *FileName = "tspc.conf";
+-char *LogFile = "tspc.log";
++char *FileName = "/etc/tsp/tspc.conf";
++char *LogFile = "/var/log/tspc.log";
+ char *LogFileName = NULL;
+-char *ScriptInterpretor = "/bin/sh";
++char *ScriptInterpretor = "";
+ char *ScriptExtension = "sh";
+ char *ScriptDir = NULL;
+-char *TspHomeDir = "/usr/local/etc/tsp";
++char *TspHomeDir = "/etc/tsp";
+ char DirSeparator = '/';
+
+ int Verbose = 0;
+@@ -143,7 +143,7 @@
+ {
+ int tunfd;
+
+- Display(0, ELInfo, "tspStartLocal", "Going daemon, check %s for tunnel creation status", LogFile);
++ Display(1, ELInfo, "tspStartLocal", "Going daemon, check %s for tunnel creation status", LogFile);
+
+ if (daemon(0,0) == -1) {
+ Display(1, ELError, "tspStartLocal", "Unable to fork.");
+--- tspc-2.1.1.orig/setup.diff
++++ tspc-2.1.1/setup.diff
+@@ -0,0 +1,65 @@
++--- tspc-2.1.1.orig/template/linux.sh
+++++ tspc-2.1.1/template/linux.sh
++@@ -149,7 +149,7 @@
++ #Better way on linux to avoid loop with the remaining /48?
++ $route -A inet6 add $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE 2>/dev/null
++ fi
++- Exec $sysctl -w net.ipv6.conf.all.forwarding=1 # ipv6_forwarding enabled
+++ Exec $sysctl -w net.ipv6.conf.all.forwarding=1 >/dev/null
++ Display 1 "Adding prefix to $TSP_HOME_INTERFACE"
++ OLDADDR=`$ifconfig $TSP_HOME_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"`
++ if [ ! -z $OLDADDR ]; then
++@@ -158,27 +158,33 @@
++ fi
++ Exec $ifconfig $TSP_HOME_INTERFACE add $TSP_PREFIX::1/64
++ # Router advertisement configuration
++- Display 1 "Create new $rtadvdconfigfile"
++- echo "##### rtadvd.conf made by TSP ####" > "$rtadvdconfigfile"
++- echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile"
++- echo "{" >> "$rtadvdconfigfile"
++- echo " AdvSendAdvert on;" >> "$rtadvdconfigfile"
++- echo " prefix $TSP_PREFIX::/64" >> "$rtadvdconfigfile"
++- echo " {" >> "$rtadvdconfigfile"
++- echo " AdvOnLink on;" >> "$rtadvdconfigfile"
++- echo " AdvAutonomous on;" >> "$rtadvdconfigfile"
++- echo " };" >> "$rtadvdconfigfile"
++- echo "};" >> "$rtadvdconfigfile"
++- echo "" >> "$rtadvdconfigfile"
++- /etc/init.d/radvd stop
++- if [ -f $rtadvdconfigfile ]; then
++- KillProcess $rtadvdconfigfile
++- Exec $rtadvd -u radvd -C $rtadvdconfigfile
++- Display 1 "Starting radvd: $rtadvd -u radvd -C $rtadvdconfigfile"
++- else
++- echo "Error : file $rtadvdconfigfile not found"
++- exit 1
++- fi
+++###
+++### The ArchLinux package does not want to mess with your radvd configuration.
+++### If you run an IPv6 router, please configure radvd on your own or
+++### reactivate the part below on your own.
+++### (From the Debian package)
+++###
+++# Display 1 "Create new $rtadvdconfigfile"
+++# echo "##### rtadvd.conf made by TSP ####" > "$rtadvdconfigfile"
+++# echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile"
+++# echo "{" >> "$rtadvdconfigfile"
+++# echo " AdvSendAdvert on;" >> "$rtadvdconfigfile"
+++# echo " prefix $TSP_PREFIX::/64" >> "$rtadvdconfigfile"
+++# echo " {" >> "$rtadvdconfigfile"
+++# echo " AdvOnLink on;" >> "$rtadvdconfigfile"
+++# echo " AdvAutonomous on;" >> "$rtadvdconfigfile"
+++# echo " };" >> "$rtadvdconfigfile"
+++# echo "};" >> "$rtadvdconfigfile"
+++# echo "" >> "$rtadvdconfigfile"
+++# /etc/init.d/radvd stop
+++# if [ -f $rtadvdconfigfile ]; then
+++# KillProcess $rtadvdconfigfile
+++# Exec $rtadvd -u radvd -C $rtadvdconfigfile
+++# Display 1 "Starting radvd: $rtadvd -u radvd -C $rtadvdconfigfile"
+++# else
+++# echo "Error : file $rtadvdconfigfile not found"
+++# exit 1
+++# fi
++ fi
++
++ Display 1 "--- End of configuration script. ---"
+--- tspc-2.1.1.orig/template/linux.sh
++++ tspc-2.1.1/template/linux.sh
+@@ -135,9 +135,7 @@
+ #
+ # Default route
+ Display 1 "Adding default route"
+- ExecNoCheck $route -A inet6 del ::/0 2>/dev/null # delete old default route
+ ExecNoCheck $route -A inet6 del 2000::/3 2>/dev/null # delete old gw route
+- Exec $route -A inet6 add ::/0 dev $TSP_TUNNEL_INTERFACE
+ Exec $route -A inet6 add 2000::/3 dev $TSP_TUNNEL_INTERFACE
+ fi
+
+@@ -147,9 +145,10 @@
+ Display 1 "Kernel setup"
+ if [ X"${TSP_PREFIXLEN}" != X"64" ]; then
+ #Better way on linux to avoid loop with the remaining /48?
+- $route -A inet6 add $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE 2>/dev/null
++ ExecNoCheck $route -A inet6 del $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE 2>/dev/null
++ Exec $route -A inet6 add $TSP_PREFIX::/$TSP_PREFIXLEN dev $TSP_HOME_INTERFACE
+ fi
+- Exec $sysctl -w net.ipv6.conf.all.forwarding=1 # ipv6_forwarding enabled
++ Exec $sysctl -q -w net.ipv6.conf.all.forwarding=1 # ipv6_forwarding enabled
+ Display 1 "Adding prefix to $TSP_HOME_INTERFACE"
+ OLDADDR=`$ifconfig $TSP_HOME_INTERFACE | grep "inet6.* $PREF" | sed -e "s/^.*inet6 addr: //" -e "s/ Scope.*\$//"`
+ if [ ! -z $OLDADDR ]; then
+@@ -157,28 +156,28 @@
+ Exec $ifconfig $TSP_HOME_INTERFACE inet6 del $OLDADDR
+ fi
+ Exec $ifconfig $TSP_HOME_INTERFACE add $TSP_PREFIX::1/64
+- # Router advertisement configuration
+- Display 1 "Create new $rtadvdconfigfile"
+- echo "##### rtadvd.conf made by TSP ####" > "$rtadvdconfigfile"
+- echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile"
+- echo "{" >> "$rtadvdconfigfile"
+- echo " AdvSendAdvert on;" >> "$rtadvdconfigfile"
+- echo " prefix $TSP_PREFIX::/64" >> "$rtadvdconfigfile"
+- echo " {" >> "$rtadvdconfigfile"
+- echo " AdvOnLink on;" >> "$rtadvdconfigfile"
+- echo " AdvAutonomous on;" >> "$rtadvdconfigfile"
+- echo " };" >> "$rtadvdconfigfile"
+- echo "};" >> "$rtadvdconfigfile"
+- echo "" >> "$rtadvdconfigfile"
+- /etc/init.d/radvd stop
+- if [ -f $rtadvdconfigfile ]; then
+- KillProcess $rtadvdconfigfile
+- Exec $rtadvd -u radvd -C $rtadvdconfigfile
+- Display 1 "Starting radvd: $rtadvd -u radvd -C $rtadvdconfigfile"
+- else
+- echo "Error : file $rtadvdconfigfile not found"
+- exit 1
+- fi
++# # Router advertisement configuration
++# Display 1 "Create new $rtadvdconfigfile"
++# echo "##### rtadvd.conf made by TSP ####" > "$rtadvdconfigfile"
++# echo "interface $TSP_HOME_INTERFACE" >> "$rtadvdconfigfile"
++# echo "{" >> "$rtadvdconfigfile"
++# echo " AdvSendAdvert on;" >> "$rtadvdconfigfile"
++# echo " prefix $TSP_PREFIX::/64" >> "$rtadvdconfigfile"
++# echo " {" >> "$rtadvdconfigfile"
++# echo " AdvOnLink on;" >> "$rtadvdconfigfile"
++# echo " AdvAutonomous on;" >> "$rtadvdconfigfile"
++# echo " };" >> "$rtadvdconfigfile"
++# echo "};" >> "$rtadvdconfigfile"
++# echo "" >> "$rtadvdconfigfile"
++# /etc/init.d/radvd stop
++# if [ -f $rtadvdconfigfile ]; then
++# KillProcess $rtadvdconfigfile
++# Exec $rtadvd -u radvd -C $rtadvdconfigfile
++# Display 1 "Starting radvd: $rtadvd -u radvd -C $rtadvdconfigfile"
++# else
++# echo "Error : file $rtadvdconfigfile not found"
++# exit 1
++# fi
+ fi
+
+ Display 1 "--- End of configuration script. ---"
+--- tspc-2.1.1.orig/debian/tspc.init
++++ tspc-2.1.1/debian/tspc.init
+@@ -0,0 +1,66 @@
++#! /bin/sh
++### BEGIN INIT INFO
++# Provides: tspc
++# Required-Start: $remote_fs
++# Required-Stop: $remote_fs
++# Default-Start: S
++# Default-Stop: 0 6
++# Short-Description: Script to configure the IPv6 tunnel to tspc
++### END INIT INFO
++#
++# Written by Martin Waitz <tali@debian.org>
++
++PATH=/sbin:/bin:/usr/sbin:/usr/bin
++TSPC=/usr/sbin/tspc
++
++test -f $TSPC || exit 0
++
++
++# read tsp client config, to get the interface used
++. /etc/tsp/tspc.conf
++
++start() {
++ start-stop-daemon --start --quiet --exec $TSPC || exit 1
++}
++
++stop() {
++ start-stop-daemon --stop --quiet --exec $TSPC || exit 1
++ ip tunnel del $if_tunnel_v6v4 2>/dev/null
++ ip tunnel del $if_tunnel_v6udpv6 2>/dev/null
++}
++
++
++case "$1" in
++ start)
++ echo -n "Setting up IPv6 tunnel: "
++ start
++ if test "$?" = 0; then
++ echo "done.";
++ else
++ echo "failed."
++ exit 1
++ fi
++ ;;
++ stop)
++ echo -n "Shutting down IPv6 tunnel: "
++ stop
++ echo "done."
++ ;;
++ restart|force-reload)
++ echo -n "Restarting IPv6 tunnel: "
++ stop
++ start
++ if test "$?" = 0; then
++ echo "done.";
++ else
++ echo "failed."
++ exit 1
++ fi
++ ;;
++ *)
++ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
++ exit 1
++ ;;
++esac
++
++exit 0
diff --git a/tspc b/tspc
new file mode 100755
index 000000000000..b21ffe9ae394
--- /dev/null
+++ b/tspc
@@ -0,0 +1,59 @@
+#! /bin/sh
+# $Id$
+# Startup script from the Debian tspc package
+# Written by Martin Waitz <tali@debian.org>
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+TSPC=/usr/sbin/tspc
+
+test -f $TSPC || exit 0
+
+
+# read tsp client config, to get the interface used
+. /etc/tsp/tspc.conf
+
+start() {
+ $TSPC || exit 1
+}
+
+stop() {
+ killall $TSPC || exit 1
+ ip tunnel del $if_tunnel_v6v4 2>/dev/null
+ ip tunnel del $if_tunnel_v6udpv6 2>/dev/null
+}
+
+
+case "$1" in
+ start)
+ echo -n "Setting up IPv6 tunnel: "
+ start
+ if test "$?" = 0; then
+ echo "done.";
+ else
+ echo "failed."
+ exit 1
+ fi
+ ;;
+ stop)
+ echo -n "Shutting down IPv6 tunnel: "
+ stop
+ echo "done."
+ ;;
+ restart|force-reload)
+ echo -n "Restarting IPv6 tunnel: "
+ stop
+ start
+ if test "$?" = 0; then
+ echo "done.";
+ else
+ echo "failed."
+ exit 1
+ fi
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0