From 3bd08043ffcc56fc7566645eadf82e74e72b2fe4 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 13 Nov 2024 16:56:44 +0100 Subject: [PATCH 1/4] Fix https://github.com/Ysurac/openmptcprouter/issues/3649 on backup config to VPS --- openmptcprouter/files/etc/init.d/openmptcprouter-vps | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openmptcprouter/files/etc/init.d/openmptcprouter-vps b/openmptcprouter/files/etc/init.d/openmptcprouter-vps index a5a380082..7767211b0 100755 --- a/openmptcprouter/files/etc/init.d/openmptcprouter-vps +++ b/openmptcprouter/files/etc/init.d/openmptcprouter-vps @@ -735,6 +735,7 @@ set_gre_tunnel() { _get_pihole() { + [ "$(uci -q get openmptcprouter.settings.pihole_auto_conf)" = "0" ] && return [ -z "$vps_config" ] && vps_config=$(_get_json "config") [ -z "$vps_config" ] && return vpn="$(uci -q get openmptcprouter.settings.vpn)" @@ -2054,7 +2055,9 @@ _backup_send() { logger -t "OMR-VPS" "Send backup file to server $servername" local backupjson backupjson='{"data": "'$backup_data'","sha256sum": "'$backup_sha256sum'"}' - result=$(_set_json "backuppost" "$backupjson") + echo "$backupjson" > /tmp/backupjson + result=$(_set_json "backuppost" "@/tmp/backupjson") + rm -f /tmp/backupjson uci -q set openmptcprouter.$servername.lastbackup=$(date +%s) } } From ba9e0f663b79e7f398f40fd35b4e5067801ecac8 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 13 Nov 2024 16:57:07 +0100 Subject: [PATCH 2/4] Fix Link Quality check in OMR-Tracker --- omr-tracker/files/bin/omr-tracker | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/omr-tracker/files/bin/omr-tracker b/omr-tracker/files/bin/omr-tracker index 4340a1bf5..d2c629a00 100755 --- a/omr-tracker/files/bin/omr-tracker +++ b/omr-tracker/files/bin/omr-tracker @@ -601,22 +601,21 @@ while true; do fi fi if [ "$OMR_TRACKER_CHECK_QUALITY" = "1" ]; then - if [ "$OMR_TRACKER_PREV_STATUS" = "OK" ]; then - if [ -n "$OMR_TRACKER_LOSS" ] && [ "$OMR_TRACKER_LOSS" -ge "$OMR_TRACKER_LOSS_FAILURE" ] && [ "$OMR_TRACKER_STATUS" = "OK" ]; then + if [ "$OMR_TRACKER_PREV_STATUS" = "OK" ] && [ "$OMR_TRACKER_STATUS" = "OK" ]; then + if [ -n "$OMR_TRACKER_LOSS" ] && [ -n "$OMR_TRACKER_RECOVERY_LOSS" ] && [ "$OMR_TRACKER_LOSS" -ge "$OMR_TRACKER_FAILURE_LOSS" ]; then OMR_TRACKER_STATUS="ERROR" - OMR_TRACKER_STATUS_MSG="Packet loss is $OMR_TRACKER_LOSS this is more than limit defined at $OMR_TRACKER_LOSS_FAILURE" - fi - if [ -n "$OMR_TRACKER_LATENCY" ] && [ "$OMR_TRACKER_LATENCY" -ge "$OMR_TRACKER_LATENCY_FAILURE" ] && [ "$OMR_TRACKER_STATUS" = "OK" ]; then + OMR_TRACKER_STATUS_MSG="Packet loss is $OMR_TRACKER_LOSS this is more than failure limit defined at $OMR_TRACKER_FAILURE_LOSS" + elif [ -n "$OMR_TRACKER_LATENCY" ] && [ -n "$OMR_TRACKER_FAILURE_LATENCY"] && [ "$OMR_TRACKER_LATENCY" -ge "$OMR_TRACKER_FAILURE_LATENCY" ]; then OMR_TRACKER_STATUS="ERROR" - OMR_TRACKER_STATUS_MSG="Latency is $OMR_TRACKER_LATENCY this is more than limit defined at $OMR_TRACKER_LATENCY_FAILURE" + OMR_TRACKER_STATUS_MSG="Latency is $OMR_TRACKER_LATENCY this is more than failure limit defined at $OMR_TRACKER_FAILURE_LATENCY" fi - elif [ "$OMR_TRACKER_PREV_STATUS" = "ERROR" ]; then - OMR_TRACKER_STATUS="ERROR" - if [ -n "$OMR_TRACKER_LOSS" ] && [ "$OMR_TRACKER_LOSS" -le "$OMR_TRACKER_LOSS_RECOVERY" ] && [ "$OMR_TRACKER_STATUS" = "OK" ]; then - OMR_TRACKER_STATUS="OK" - fi - if [ -n "$OMR_TRACKER_LATENCY" ] && [ "$OMR_TRACKER_LATENCY" -ge "$OMR_TRACKER_LATENCY_RECOVERY" ] && [ "$OMR_TRACKER_STATUS" = "OK" ]; then - OMR_TRACKER_STATUS="OK" + elif [ "$OMR_TRACKER_PREV_STATUS" = "ERROR" ] && [ "$OMR_TRACKER_STATUS" = "OK" ]; then + if [ -n "$OMR_TRACKER_LOSS" ] && [ -n "$OMR_TRACKER_RECOVERY_LOSS" ] && [ "$OMR_TRACKER_LOSS" -ge "$OMR_TRACKER_RECOVERY_LOSS" ]; then + OMR_TRACKER_STATUS="ERROR" + OMR_TRACKER_STATUS_MSG="Packet loss is $OMR_TRACKER_LOSS this is more than recovery limit defined at $OMR_TRACKER_RECOVERY_LOSS" + elif [ -n "$OMR_TRACKER_LATENCY" ] && [ -n "$OMR_TRACKER_RECOVERY_LATENCY" ] && [ "$OMR_TRACKER_LATENCY" -ge "$OMR_TRACKER_RECOVERY_LATENCY" ]; then + OMR_TRACKER_STATUS="ERROR" + OMR_TRACKER_STATUS_MSG="Latency is $OMR_TRACKER_LATENCY this is more than recovery limit defined at $OMR_TRACKER_RECOVERY_LATENCY" fi fi fi From 20b12a83bde64929b41323eeb4801297d494d8aa Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 13 Nov 2024 16:57:34 +0100 Subject: [PATCH 3/4] For upnp disable --- openmptcprouter/files/etc/uci-defaults/2092-upnpd | 1 + 1 file changed, 1 insertion(+) diff --git a/openmptcprouter/files/etc/uci-defaults/2092-upnpd b/openmptcprouter/files/etc/uci-defaults/2092-upnpd index 34302eb69..49b84adb5 100755 --- a/openmptcprouter/files/etc/uci-defaults/2092-upnpd +++ b/openmptcprouter/files/etc/uci-defaults/2092-upnpd @@ -3,6 +3,7 @@ if [ "$(uci -q get upnpd.config.external_ifac)" != "omrvpn" ]; then uci -q batch <<-EOF >/dev/null set upnpd.config.external_iface=omrvpn + set upnpd.config.enabled='0' commit upnpd EOF fi From cee2ec000c85267e4553990339c6160b08a03a8f Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 13 Nov 2024 16:58:07 +0100 Subject: [PATCH 4/4] xtables-addons patches is needed since at least kernel 6.10 --- xtables-addons/patches/301-fix-build-with-linux-6.11.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xtables-addons/patches/301-fix-build-with-linux-6.11.patch b/xtables-addons/patches/301-fix-build-with-linux-6.11.patch index 15ebf12a4..45de661fa 100644 --- a/xtables-addons/patches/301-fix-build-with-linux-6.11.patch +++ b/xtables-addons/patches/301-fix-build-with-linux-6.11.patch @@ -4,7 +4,7 @@ } #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0) strlcpy(hlpr->name, tmpname, sizeof(hlpr->name)); #else + strscpy(hlpr->name, tmpname, sizeof(hlpr->name));