From: Sergey Matveev Date: Fri, 12 Feb 2016 08:04:52 +0000 (+0300) Subject: Merge branch 'develop' X-Git-Tag: 5.6^0 X-Git-Url: http://www.git.cypherpunks.ru/?p=govpn.git;a=commitdiff_plain;h=124b8310c8fa341a8309ec71a295a7a0fb057950;hp=5418a3da373c4e87b34babba6cc754b7bd57ed1b Merge branch 'develop' --- diff --git a/VERSION b/VERSION index 9ad974f..2df33d7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.5 +5.6 diff --git a/doc/Makefile b/doc/Makefile index d51a843..1d1032d 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -6,7 +6,7 @@ handshake.utxt: handshake.txt plantuml -tutxt handshake.txt govpn.info: *.texi handshake.utxt - $(MAKEINFO) index.texi + $(MAKEINFO) -o govpn.info index.texi govpn.html: *.texi handshake.utxt rm -f govpn.html/*.html diff --git a/doc/download.texi b/doc/download.texi index a8710f0..7828870 100644 --- a/doc/download.texi +++ b/doc/download.texi @@ -6,6 +6,10 @@ You can obtain releases source code prepared tarballs from the links below: @multitable {XXXXX} {XXXX KiB} {link sign} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} @headitem Version @tab Size @tab Tarball @tab SHA256 checksum +@item @ref{Release 5.5, 5.5} @tab 310 KiB +@tab @url{download/govpn-5.5.tar.xz, link} @url{download/govpn-5.5.tar.xz.sig, sign} +@tab @code{2f32e02c34a13eae538be7b44c11e16a8e68c43afc8e4a3071172f9c52b861d8} + @item @ref{Release 5.4, 5.4} @tab 310 KiB @tab @url{download/govpn-5.4.tar.xz, link} @url{download/govpn-5.4.tar.xz.sig, sign} @tab @code{a1a001d9ef899ff6b61872eb7d2425a09eb0161574f50c8da6e4b14beb9b0ff6} diff --git a/doc/example.texi b/doc/example.texi index 619e9c6..5f28a7f 100644 --- a/doc/example.texi +++ b/doc/example.texi @@ -64,7 +64,8 @@ client% ip addr add 192.168.0.2/24 dev wlan0 client% ip tuntap add dev tap10 mode tap client% ip addr add 172.16.0.2/24 dev tap10 client% ip link set up dev tap10 -client% ip route add default via 172.16.0.1 +client% ip route add 0/1 via 172.16.0.1 +client% ip route add 128/1 via 172.16.0.1 @end verbatim @strong{Run client daemon itself}: diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 5e8efbe..15219a6 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -1,6 +1,15 @@ @node Новости @section Новости +@node Релиз 5.6 +@subsection Релиз 5.6 +@itemize +@item Добавлен up/down скрипт-пример для подмены маршрута по-умолчанию +(спасибо Zhuoyun Wei). +@item Исправлена ошибка при генерировании документации: @file{.info} +файл не устанавливался. +@end itemize + @node Релиз 5.5 @subsection Релиз 5.5 @itemize diff --git a/doc/news.texi b/doc/news.texi index a33f415..99edbe6 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -3,6 +3,14 @@ See also this page @ref{Новости, on russian}. +@node Release 5.6 +@section Release 5.6 +@itemize +@item Added up/down example script for replacing default route (thanks +to Zhuoyun Wei). +@item Fixed documentation bug: @file{.info} was not installing. +@end itemize + @node Release 5.5 @section Release 5.5 @itemize diff --git a/src/cypherpunks.ru/govpn/peer.go b/src/cypherpunks.ru/govpn/peer.go index a9c0aaa..5160bd4 100644 --- a/src/cypherpunks.ru/govpn/peer.go +++ b/src/cypherpunks.ru/govpn/peer.go @@ -79,7 +79,7 @@ type Peer struct { // Basic Addr string Id *PeerId - Conn io.Writer + Conn io.Writer `json:"-"` // Traffic behaviour NoiseEnable bool diff --git a/utils/addroute.sh b/utils/addroute.sh new file mode 100755 index 0000000..a8d85cd --- /dev/null +++ b/utils/addroute.sh @@ -0,0 +1,50 @@ +#!/bin/sh -x + +# A simple script handling default routing for GoVPN, +# inspired by vpnc-script, but much simpler. + +# List of parameters passed through environment +# - reason -- why this script is called: +# pre-init, connect, disconnect +# - VPNGATEWAY -- public address of vpn gateway +# - TAPDEV -- tap device +# - INTERNAL_IP4_ADDRESS -- e.g. 172.0.0.2/24 +# - INTERNAL_IP4_GATEWAY -- e.g. 172.0.0.1 + + +set_up_dev() { + ip tuntap add dev $TAPDEV mode tap +} + + +tear_down_dev() { + ip tuntap del dev $TAPDEV mode tap +} + + +do_connect() { + local OLDGW=$(ip route show 0/0 | sed 's/^default//') + ip link set dev $TAPDEV up + ip addr add $INTERNAL_IP4_ADDRESS dev $TAPDEV + ip route add $VPNGATEWAY $OLDGW + ip route add 0/1 via $INTERNAL_IP4_GATEWAY dev $TAPDEV + ip route add 128/1 via $INTERNAL_IP4_GATEWAY dev $TAPDEV +} + + +do_disconnect() { + ip route del $VPNGATEWAY +} + + +case $reason in + pre-init) + set_up_dev + ;; + connect) + do_connect + ;; + disconnect) + do_disconnect + ;; +esac