for (x2 = x->children; x2; x2 = x2->next) {
if (!xmlnode_get_val(x2, "hip-report-interval", &hip_interval)) {
int sec = atoi(hip_interval);
- if (!vpninfo->csd_wrapper)
- vpn_progress(vpninfo, PRG_INFO, _("Ignoring portal's HIP report interval (%d minutes), because no HIP report script provided.\n"),
- sec/60);
- else if (vpninfo->trojan_interval)
+ if (vpninfo->trojan_interval)
vpn_progress(vpninfo, PRG_INFO, _("Ignoring portal's HIP report interval (%d minutes), because interval is already set to %d minutes.\n"),
sec/60, vpninfo->trojan_interval/60);
else {
#endif
if (!vpninfo->csd_wrapper) {
- vpn_progress(vpninfo, PRG_ERR,
- _("WARNING: Server asked us to submit HIP report with md5sum %s.\n"
- " VPN connectivity may be disabled or limited without HIP report submission.\n %s\n"),
- vpninfo->csd_token,
+ /* Only warn once */
+ if (!vpninfo->last_trojan) {
+ vpn_progress(vpninfo, PRG_ERR,
+ _("WARNING: Server asked us to submit HIP report with md5sum %s.\n"
+ " VPN connectivity may be disabled or limited without HIP report submission.\n %s\n"),
+ vpninfo->csd_token,
#if defined(_WIN32) || defined(__native_client__)
- _("However, running the HIP report submission script on this platform is not yet implemented.")
+ _("However, running the HIP report submission script on this platform is not yet implemented.")
#else
- _("You need to provide a --csd-wrapper argument with the HIP report submission script.")
+ _("You need to provide a --csd-wrapper argument with the HIP report submission script.")
#endif
- );
- /* XXX: Many GlobalProtect VPNs work fine despite allegedly requiring HIP report submission */
+ );
+ /* XXX: Many GlobalProtect VPNs work fine despite allegedly requiring HIP report submission */
+ }
return 0;
}
if (ret)
goto out;
- /* Always check HIP once (even if no --csd-wrapper specified) */
- if (!vpninfo->last_trojan) {
- ret = check_and_maybe_submit_hip_report(vpninfo);
- if (ret)
- goto out;
- }
+ /* Always check HIP after getting configuration */
+ ret = check_and_maybe_submit_hip_report(vpninfo);
+ if (ret)
+ goto out;
+
+ /* XX: last_trojan is used both as a sentinel to detect the
+ * first time we check/submit HIP, and for the mainloop to timeout
+ * when periodic re-checking is required.
+ */
+ vpninfo->last_trojan = time(NULL);
/* Default HIP re-checking to 3600 seconds unless already set by
- * --force-trojan or portal config. There's no point to rechecking
- * HIP if --csd-wrapper wasn't specified: either the VPN will
- * work despite lack of HIP submission, or it won't.
+ * --force-trojan or portal config.
*/
- if (vpninfo->csd_wrapper && !vpninfo->trojan_interval)
+ if (!vpninfo->trojan_interval)
vpninfo->trojan_interval = 3600;
- vpninfo->last_trojan = time(NULL);
/* Connect tunnel immediately if ESP is not going to be used */
ret = gpst_connect(vpninfo);