[RFC 3/4] Removed fastd

Tim Niemeyer tim at tn-x.org
Mo Mär 14 22:06:24 CET 2016


Hi

Das sollten wir auf keinen Fall einfach rauswerfen. Ich habe bereits ein
Patch vorbereitet, der fastd in ein Package packt. Leider gibts da noch
n kleines Problemchen mit dem Template-Parameter.

So lange tunneldigger noch im Test ist, bin ich der Meinung, dass man
die Packages dann manuell an/ab-wählen sollte. Später können wir dann
beide aktivieren und der dezentrale keyXchange wählt das richtige Tool.

Tim


Am Dienstag, den 08.03.2016, 15:51 +0100 schrieb Jan Kraus:
> Signed-off-by: Jan Kraus <mayosemmel at gmail.com>
> ---
>  bsp/ar71xx/.config                                 | 11 ---
>  bsp/default/root_file_system/etc/fastdstart.sh.tpl | 95 ----------------------
>  .../etc/hotplug.d/iface/50-fastdstart              |  5 --
>  .../root_file_system/usr/lib/micron.d/default      |  1 -
>  buildscript                                        |  2 +-
>  5 files changed, 1 insertion(+), 113 deletions(-)
>  delete mode 100755 bsp/default/root_file_system/etc/fastdstart.sh.tpl
>  delete mode 100755 bsp/default/root_file_system/etc/hotplug.d/iface/50-fastdstart
> 
> diff --git a/bsp/ar71xx/.config b/bsp/ar71xx/.config
> index 9c6e7b0..561615f 100644
> --- a/bsp/ar71xx/.config
> +++ b/bsp/ar71xx/.config
> @@ -13,12 +13,6 @@ CONFIG_ATH_USER_REGD=y
>  CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT=y
>  CONFIG_BUSYBOX_CONFIG_HTTPD=y
>  CONFIG_CLEAN_IPKG=y
> -CONFIG_FASTD_ENABLE_CIPHER_NULL=y
> -CONFIG_FASTD_ENABLE_MAC_UHASH=y
> -CONFIG_FASTD_ENABLE_METHOD_COMPOSED_UMAC=y
> -CONFIG_FASTD_ENABLE_METHOD_GENERIC_UMAC=y
> -CONFIG_FASTD_ENABLE_METHOD_NULL=y
> -CONFIG_FASTD_WITH_STATUS_SOCKET=y
>  CONFIG_KMOD_BATMAN_ADV_LEGACY_BATCTL=y
>  CONFIG_KMOD_BATMAN_ADV_LEGACY_BLA=y
>  CONFIG_KMOD_BATMAN_ADV_LEGACY_DAT=y
> @@ -28,7 +22,6 @@ CONFIG_PACKAGE_arptables=y
>  # CONFIG_PACKAGE_dnsmasq is not set
>  CONFIG_PACKAGE_ebtables=y
>  CONFIG_PACKAGE_ebtables-utils=y
> -CONFIG_PACKAGE_fastd=y
>  # CONFIG_PACKAGE_firewall is not set
>  CONFIG_PACKAGE_gpioctl-sysfs=y
>  CONFIG_PACKAGE_ip=y
> @@ -73,7 +66,3 @@ CONFIG_PACKAGE_qos-scripts=y
>  CONFIG_PACKAGE_tc=y
>  CONFIG_PACKAGE_tunneldigger=y
>  CONFIG_PACKAGE_wireless-tools=y
> -# CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 is not set
> -# CONFIG_FASTD_ENABLE_MAC_GHASH is not set
> -# CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC is not set
> -# CONFIG_FASTD_ENABLE_METHOD_GENERIC_GMAC is not set
> diff --git a/bsp/default/root_file_system/etc/fastdstart.sh.tpl b/bsp/default/root_file_system/etc/fastdstart.sh.tpl
> deleted file mode 100755
> index 5bb5165..0000000
> --- a/bsp/default/root_file_system/etc/fastdstart.sh.tpl
> +++ /dev/null
> @@ -1,95 +0,0 @@
> -#!/bin/sh
> -
> -SERVER="no"
> -#SERVERNAME="--servername--"
> -
> -project="${VPN_PROJECT}"
> -
> -test_ipv4_host1="keyserver.freifunk-franken.de" # Freifunk-Franken keyserver
> -test_ipv4_host2="8.8.8.8"        # Google DNS
> -test_ipv6_host1="heise.de"       # heise Zeitschriftenverlag
> -
> -if [ "$SERVER" = "no" ]; then
> -	test -f /tmp/started || exit
> -fi
> -
> -# Only do something with fastd when the router has internet connection
> -if ping -w5 -c3 "$test_ipv4_host1" &>/dev/null || 
> -   ping -w5 -c3 "$test_ipv4_host2" &>/dev/null ||
> -   ping6 -w5 -c3 "$test_ipv6_host1" &>/dev/null; then
> -	mac=$(awk '{ mac=toupper($1); gsub(":", "", mac); print mac }' /sys/class/net/br-mesh/address 2>/dev/null)
> -	if [ "$SERVER" = "no" ]; then
> -		hostname=$(cat /proc/sys/kernel/hostname)
> -
> -		if [ "$hostname" = "OpenWrt" ]; then
> -			hostname=""
> -		fi
> -
> -		if [ "$hostname" = "" ]; then
> -			hostname=$mac
> -		fi
> -	else
> -		hostname=$SERVERNAME
> -	fi
> -
> -	if [ ! -d /etc/fastd ]; then
> -		mkdir /etc/fastd
> -	fi
> -
> -	if [ ! -d /etc/fastd/$project ]; then
> -		mkdir /etc/fastd/$project
> -
> -		mkdir /tmp/fastd_${project}_peers
> -		ln -s /tmp/fastd_${project}_peers /etc/fastd/$project/peers
> -		echo "#!/bin/sh" > /etc/fastd/$project/up.sh
> -		echo "ip link set up dev ${project}VPN" >> /etc/fastd/$project/up.sh
> -		echo "echo enable > /sys/devices/virtual/net/${project}VPN/batman_adv/no_rebroadcast" >> /etc/fastd/$project/up.sh
> -		echo "batctl if add ${project}VPN" >> /etc/fastd/$project/up.sh
> -		chmod +x /etc/fastd/$project/up.sh
> -
> -		secret=$(fastd --generate-key 2>&1 | grep -i secret | awk '{ print $2 }')
> -		echo "include peers from \"/etc/fastd/$project/peers\";" >> /etc/fastd/${project}/${project}.conf
> -		echo "log to syslog level warn;" >> /etc/fastd/${project}/${project}.conf
> -		echo "method \"null\";" >> /etc/fastd/${project}/${project}.conf
> -#		http://lists.nord-west.net/pipermail/freifunk-ol-dev/2013-July/000322.html
> -#		echo "bind 0.0.0.0:10000;" >> /etc/fastd/${project}/${project}.conf
> -		echo "interface \"${project}VPN\";" >> /etc/fastd/${project}/${project}.conf
> -		echo "mtu 1426;" >> /etc/fastd/${project}/${project}.conf
> -		echo "secret \"$secret\";" >> /etc/fastd/${project}/${project}.conf
> -		echo "on up \"/etc/fastd/${project}/up.sh\";" >> /etc/fastd/${project}/${project}.conf
> -		echo "secure handshakes no;" >> /etc/fastd/${project}/${project}.conf
> -	fi
> -
> -	if [ ! -d /tmp/fastd_${project}_peers ]; then
> -		mkdir /tmp/fastd_${project}_peers
> -	fi	
> -
> -	pubkey=$(fastd -c /etc/fastd/$project/$project.conf --show-key --machine-readable)
> -#	port=666
> -	lat=$(uci get system. at system[0].latitude)
> -	long=$(uci get system. at system[0].longitude)
> -
> -#	fire up
> -	if [ "$(/sbin/ifconfig -a | grep -i ethernet | grep $project)" = "" ]; then
> -		/bin/rm /var/run/fastd.$project.pid
> -		fastd -c /etc/fastd/$project/$project.conf -d --pid-file /var/run/fastd.$project.pid
> -	fi
> -
> -#	register
> -	wget -T15 "http://keyserver.freifunk-franken.de/${project}/geo.php?mac=$mac&name=$hostname&port=$port&key=$pubkey&lat=$lat&long=$long" -O /tmp/fastd_${project}_output
> -
> -	filenames=$(awk '/^####/ { gsub(/^####/, "", $0); gsub(/.conf/, "", $0); print $0; }' /tmp/fastd_${project}_output)
> -	for file in $filenames; do
> -		awk "{ if(a) print }; /^####$file.conf$/{a=1}; /^$/{a=0};" /tmp/fastd_${project}_output | sed 's/ float;/;/g' > /etc/fastd/$project/peers/$file
> -		echo 'float yes;' >> /etc/fastd/$project/peers/$file
> -	done
> -
> -	#reload
> -	kill -HUP $(cat /var/run/fastd.$project.pid)
> -else
> -	echo "Der Router kann keine Verbindung zum Fastdserver aufbauen"
> -	echo "$0 macht nichts!"
> -fi
> -
> -exit 0
> -# vim: noexpandtab
> diff --git a/bsp/default/root_file_system/etc/hotplug.d/iface/50-fastdstart b/bsp/default/root_file_system/etc/hotplug.d/iface/50-fastdstart
> deleted file mode 100755
> index 8b435ea..0000000
> --- a/bsp/default/root_file_system/etc/hotplug.d/iface/50-fastdstart
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -#!/bin/sh 
> -[ "$ACTION" = "ifup" -a "$INTERFACE" = "wan" ] && {
> -	sleep 3
> -	sh /etc/fastdstart.sh
> -}
> diff --git a/bsp/default/root_file_system/usr/lib/micron.d/default b/bsp/default/root_file_system/usr/lib/micron.d/default
> index 3dbf3d7..21c857b 100644
> --- a/bsp/default/root_file_system/usr/lib/micron.d/default
> +++ b/bsp/default/root_file_system/usr/lib/micron.d/default
> @@ -1,2 +1 @@
> -*/5 * * * * sleep $(/usr/bin/random 0 29); sh /etc/fastdstart.sh
>  */1 * * * * /usr/sbin/batctl gw off; sleep 1; /usr/sbin/batctl gw client
> diff --git a/buildscript b/buildscript
> index 60cb673..5f84a87 100755
> --- a/buildscript
> +++ b/buildscript
> @@ -24,7 +24,7 @@ PACKAGEURL="https://github.com/openwrt/packages.git"
>  OPENWRT=(openwrt
>           $PACKAGEURL
>           $PACKAGEREV)
> -OPENWRT_PKGS="gpioctl-sysfs libugpio fastd haserl"
> +OPENWRT_PKGS="gpioctl-sysfs libugpio haserl"
>  
>  ## Be careful: FFF uses COMPAT_VERSION 14 at the moment.
>  ## See http://www.open-mesh.org/projects/batman-adv/wiki/Compatversion
> -- 
> 2.1.4
> 

-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde abgetrennt...
Dateiname   : signature.asc
Dateityp    : application/pgp-signature
Dateigröße  : 473 bytes
Beschreibung: This is a digitally signed message part
URL         : <http://lists.freifunk.net/pipermail/franken-dev-freifunk.net/attachments/20160314/59b687ee/attachment-0002.sig>


Mehr Informationen über die Mailingliste franken-dev