forked from freifunk-franken/firmware
add tinc mem leaks patch
configure LAN Port 1, 2 with batman fix reboots on wrong mac fix firmware_release
This commit is contained in:
parent
23ec67997d
commit
67489a5433
|
@ -0,0 +1,70 @@
|
|||
From 5672863e59e6a114ac6b66de98254b14266c0e61 Mon Sep 17 00:00:00 2001
|
||||
From: Guus Sliepen <guus@tinc-vpn.org>
|
||||
Date: Sat, 3 Dec 2011 21:59:47 +0100
|
||||
Subject: [PATCH 1/1] Fix a few small memory leaks.
|
||||
|
||||
---
|
||||
src/protocol_key.c | 2 --
|
||||
src/subnet.c | 2 ++
|
||||
src/tincd.c | 5 ++++-
|
||||
3 files changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/protocol_key.c b/src/protocol_key.c
|
||||
index f34ebaa..a7d4447 100644
|
||||
--- a/src/protocol_key.c
|
||||
+++ b/src/protocol_key.c
|
||||
@@ -242,8 +242,6 @@ bool ans_key_h(connection_t *c) {
|
||||
|
||||
/* Update our copy of the origin's packet key */
|
||||
from->outkey = xrealloc(from->outkey, strlen(key) / 2);
|
||||
-
|
||||
- from->outkey = xstrdup(key);
|
||||
from->outkeylength = strlen(key) / 2;
|
||||
hex2bin(key, from->outkey, from->outkeylength);
|
||||
|
||||
diff --git a/src/subnet.c b/src/subnet.c
|
||||
index 47f1436..7fffe63 100644
|
||||
--- a/src/subnet.c
|
||||
+++ b/src/subnet.c
|
||||
@@ -468,6 +468,8 @@ void subnet_update(node_t *owner, subnet_t *subnet, bool up) {
|
||||
// 4 and 5 are reserved for SUBNET and WEIGHT
|
||||
xasprintf(&envp[6], "REMOTEADDRESS=%s", address);
|
||||
xasprintf(&envp[7], "REMOTEPORT=%s", port);
|
||||
+ free(port);
|
||||
+ free(address);
|
||||
}
|
||||
|
||||
name = up ? "subnet-up" : "subnet-down";
|
||||
diff --git a/src/tincd.c b/src/tincd.c
|
||||
index b3d911b..f075168 100644
|
||||
--- a/src/tincd.c
|
||||
+++ b/src/tincd.c
|
||||
@@ -612,7 +612,7 @@ int main2(int argc, char **argv) {
|
||||
|
||||
/* Change process priority */
|
||||
|
||||
- char *priority = 0;
|
||||
+ char *priority = NULL;
|
||||
|
||||
if(get_config_string(lookup_config(config_tree, "ProcessPriority"), &priority)) {
|
||||
if(!strcasecmp(priority, "Normal")) {
|
||||
@@ -661,6 +661,8 @@ end:
|
||||
remove_pid(pidfilename);
|
||||
#endif
|
||||
|
||||
+ free(priority);
|
||||
+
|
||||
EVP_cleanup();
|
||||
ENGINE_cleanup();
|
||||
CRYPTO_cleanup_all_ex_data();
|
||||
@@ -668,6 +670,7 @@ end:
|
||||
ERR_free_strings();
|
||||
|
||||
exit_configuration(&config_tree);
|
||||
+ list_free(cmdline_conf);
|
||||
free_names();
|
||||
|
||||
return status;
|
||||
--
|
||||
1.7.2.5
|
||||
|
|
@ -16,6 +16,9 @@ prepare() {
|
|||
|
||||
patch -p0 < ./build_patches/blaII/Makefile.patch ./build_dir/feeds/batman/batman-adv-devel/Makefile
|
||||
|
||||
# fix some tinc mem leaks
|
||||
mkdir ./build_dir/feeds/packages/net/tinc/patches
|
||||
cp ./build_patches/tinc/001_fix_a_few_small_memory_leaks.patch ./build_dir/feeds/packages/net/tinc/patches/001_fix_a_few_small_memory_leaks.patch
|
||||
|
||||
case "$1" in
|
||||
"dir300")
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
config 'mesh' 'bat0'
|
||||
option 'interfaces' 'wlanmesh'
|
||||
option 'interfaces' 'wlanmesh ethmesh1, ethmesh2'
|
||||
option 'orig_interval'
|
||||
option 'log_level'
|
||||
option 'aggregated_ogms'
|
||||
|
|
|
@ -15,4 +15,4 @@ config 'update'
|
|||
|
||||
config 'network'
|
||||
option 'mesh_interface' 'br-mesh'
|
||||
option 'client_interfaces' 'ath0 wlan0'
|
||||
option 'client_interfaces' 'ath0 wlan0 eth0.1'
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
FIRMWARE_VERSION="trunk"
|
||||
FIRMWARE_VERSION="0.3beta"
|
||||
RELEASE_DATE=""
|
||||
FIRMWARE_REVISION="541"
|
||||
OPENWRT_CORE_REVISION="29672"
|
||||
OPENWRT_FEEDS_PACKAGES_REVISION="29597"
|
||||
|
|
|
@ -17,23 +17,16 @@ if [[ "$BRMAC" != "$WLMAC" ]]; then
|
|||
logger -s "Fixing wrong MAC on br-mesh"
|
||||
uci set network.mesh.macaddr=$WLMAC
|
||||
uci commit
|
||||
ifconfig br-mesh hw ether $WLMAC
|
||||
ifconfig br-mesh down
|
||||
ifconfig br-mesh up
|
||||
#wait before reboot to generate tinc certificates and to be able
|
||||
#to login over ssh bevore reboot in case of errors
|
||||
sleep 30
|
||||
reboot
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
ifconfig br-mesh down
|
||||
ifconfig br-mesh up
|
||||
|
||||
rdate -s time.fu-berlin.de
|
||||
|
||||
chown root.root /etc/crontabs/root
|
||||
/etc/init.d/cron stop
|
||||
/etc/init.d/cron start
|
||||
|
||||
sh /etc/firewall.user
|
||||
|
||||
/etc/init.d/qos disable
|
||||
|
|
|
@ -24,13 +24,29 @@ config 'switch' 'eth0'
|
|||
config 'switch_vlan' 'eth0_1'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '1'
|
||||
option 'ports' '0 1 2 3 5t'
|
||||
option 'ports' '0 1 5t'
|
||||
|
||||
config 'switch_vlan' 'eth0_2'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '2'
|
||||
option 'ports' '4 5t'
|
||||
|
||||
config 'switch_vlan' 'eth0_3'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '3'
|
||||
option 'ports' '2 5t'
|
||||
|
||||
config 'switch_vlan' 'eth0_4'
|
||||
option 'device' 'eth0'
|
||||
option 'vlan' '4'
|
||||
option 'ports' '3 5t'
|
||||
|
||||
config 'interface' 'ethmesh1'
|
||||
option 'ifname' 'eth0.3'
|
||||
|
||||
config 'interface' 'ethmesh2'
|
||||
option 'ifname' 'eth0.4'
|
||||
|
||||
config 'interface' 'wan'
|
||||
option 'ifname' 'eth0.2'
|
||||
option 'proto' 'dhcp'
|
||||
|
|
Loading…
Reference in New Issue