Fix - workaround for Android refusing to resolve local fqdn status.client

Signed-off-by: Rob White <rob@blue-wave.net>
This commit is contained in:
Rob White
2025-11-29 22:27:55 +00:00
parent fd737616ba
commit 10d49f99fe
2 changed files with 9 additions and 4 deletions

View File

@@ -787,7 +787,7 @@ static int authenticated(struct MHD_Connection *connection,
originurl_raw = safe_calloc(SMALL_BUF);
captive_json = safe_calloc(SMALL_BUF);
if (strcmp(config->gw_fqdn, "disable") == 0 || strcmp(config->gw_fqdn, "disabled") == 0) {
if (strcmp(config->gw_fqdn, "disable") == 0 || strcmp(config->gw_fqdn, "disabled") == 0 || strcmp(config->gw_fqdn, "status.client") == 0) {
safe_snprintf(originurl_raw, SMALL_BUF, "http://%s", config->gw_ip);
} else {
safe_snprintf(originurl_raw, SMALL_BUF, "http://%s", config->gw_fqdn);
@@ -1169,7 +1169,7 @@ static int preauthenticated(struct MHD_Connection *connection, const char *url,
originurl_raw = safe_calloc(REDIRECT_URL);
if (strcmp(config->gw_fqdn, "disable") == 0 || strcmp(config->gw_fqdn, "disabled") == 0) {
if (strcmp(config->gw_fqdn, "disable") == 0 || strcmp(config->gw_fqdn, "disabled") == 0 || strcmp(config->gw_fqdn, "status.client") == 0) {
safe_snprintf(originurl_raw, REDIRECT_URL, "http://%s", config->gw_ip);
} else {
safe_snprintf(originurl_raw, REDIRECT_URL, "http://%s", config->gw_fqdn);
@@ -1435,7 +1435,7 @@ static char *construct_querystring(struct MHD_Connection *connection, t_client *
gw_url_raw = safe_calloc(REDIRECT_URL);
if (strcmp(config->gw_fqdn, "disable") == 0 || strcmp(config->gw_fqdn, "disabled") == 0) {
if (strcmp(config->gw_fqdn, "disable") == 0 || strcmp(config->gw_fqdn, "disabled") == 0 || strcmp(config->gw_fqdn, "status.client") == 0) {
safe_snprintf(gw_url_raw, REDIRECT_URL, "http://%s", config->gw_ip);
} else {
safe_snprintf(gw_url_raw, REDIRECT_URL, "http://%s", config->gw_fqdn);

View File

@@ -465,11 +465,16 @@ setup_from_config(void)
free(msg);
}
if (strcmp(config->gw_fqdn, "status.client") == 0) {
free(config->gw_fqdn);
config->gw_fqdn = safe_strdup(config->gw_ip);
}
if (config->dhcp_default_url_enable == 1) {
debug(LOG_DEBUG, "Enabling RFC8910 support");
dnscmd = safe_calloc(STATUS_BUF);
if (strcmp(config->gw_fqdn, "disable") != 0 && strcmp(config->gw_fqdn, "disabled") != 0) {
if (strcmp(config->gw_fqdn, "disable") != 0 && strcmp(config->gw_fqdn, "disabled") != 0 && strcmp(config->gw_fqdn, "status.client") != 0) {
safe_snprintf(dnscmd, STATUS_BUF, "/usr/lib/opennds/dnsconfig.sh \"cpidconf\" \"%s\"", config->gw_fqdn);
} else {
safe_snprintf(dnscmd, STATUS_BUF, "/usr/lib/opennds/dnsconfig.sh \"cpidconf\" \"%s\"", config->gw_address);