]> git.99rst.org Git - openwrt-packages.git/commitdiff
travelmate: treat an unresolvable captive portal as an error
authorDirk Brenken <redacted>
Sat, 8 Aug 2026 12:20:50 +0000 (14:20 +0200)
committerDirk Brenken <redacted>
Sat, 8 Aug 2026 12:20:50 +0000 (14:20 +0200)
'trm_netcheck' only ever fired on "net nok", but f_net() reports a detected
portal as "net cp" regardless of 'trm_captive' - the option gates the portal
handling, not the detection. With 'trm_captive' disabled travelmate neither
adds the portal domain to the dhcp rebind allowlist nor runs a login script,
so that state can never resolve on its own: the uplink stayed connected as
"net cp '<domain>'" forever, the vpn was never brought up (it requires "net
ok") and 'trm_netcheck' never kicked in - travelmate stuck to exactly the
uplink the option is meant to get rid of.

Downgrade "net cp" to "net nok" in f_net() when the portal handling is off.
With 'trm_captive' enabled nothing changes.

Signed-off-by: Dirk Brenken <redacted>
net/travelmate/Makefile
net/travelmate/files/README.md
net/travelmate/files/travelmate-functions.sh

index a7db32390e060b31a89a7650524b2c4093796cf0..f5b50dd05e1e74218fb44270f77ca085bef3a51e 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=travelmate
 PKG_VERSION:=2.4.7
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
 
index 08505bb4052b13306c32974639936cab2720bb47..663ecdb886201e7cf867224c2135b7f790ff096d 100644 (file)
@@ -169,7 +169,7 @@ The `status` sub-command prints the current runtime information:
 | trm_stdvpnservice  | -, not set                         | standard vpn service which will be automatically added to new STA profiles                            |
 | trm_stdvpniface    | -, not set                         | standard vpn interface which will be automatically added to new STA profiles                          |
 
-**Please note:** 'trm_netcheck' is evaluated independently of 'trm_captive'. A detected captive portal does not count as an error, such an uplink stays connected so that a manual or script based portal login is still possible. Only a failed connectivity check counts, and it is confirmed by a second probe before it is acted on. Such a failure is then handled like a failed connection attempt: after 'trm_maxretry' tries the affected uplink gets disabled in the travelmate config. A longer lasting outage of your upstream provider may therefore disable all configured uplinks, which have to be re-enabled manually.
+**Please note:** 'trm_netcheck' is evaluated independently of 'trm_captive'. A detected captive portal does not count as an error as long as 'trm_captive' is enabled - such an uplink stays connected so that a manual or script based portal login is still possible. With 'trm_captive' disabled travelmate can neither allowlist the portal domain nor run a login script, so a detected portal is treated like a failed connectivity check. Only a failed connectivity check counts, and it is confirmed by a second probe before it is acted on. Such a failure is then handled like a failed connection attempt: after 'trm_maxretry' tries the affected uplink gets disabled in the travelmate config. A longer lasting outage of your upstream provider may therefore disable all configured uplinks, which have to be re-enabled manually.
 
 * Per uplink there is an additional 'uplink' section in the travelmate config, with the following options:
 
index d5d78f9093d1d826d0110b1084a7b96a23861b1d..1aaab6788719acbfe6304bf1bf36dfba67f2884c 100644 (file)
@@ -876,6 +876,15 @@ f_net() {
                        fi
                fi
        fi
+
+       # without captive portal handling travelmate can neither allowlist the portal
+       # domain nor run a login script, so a detected portal is a dead end, not an
+       # expected intermediate state
+       #
+       case "${result}" in
+       "net cp"*) [ "${trm_captive}" = "0" ] && result="net nok" ;;
+       esac
+
        printf "%s" "${result}"
 
        f_log "debug" "f_net       ::: timeout: $((trm_maxwait / 6)), cp (url/html/js): ${json_cp:-"-"}/${html_cp:-"-"}/${js_cp:-"-"}, result: ${result}, error (rc/msg): ${json_ec}/${err_msg:-"-"}, probe_host: ${probe_host:-"-"}, eff_url: ${json_cp_url:-"-"}"
git clone https://git.99rst.org/PROJECT