Skip to content

Commit

Permalink
Add defaulting of login ip on api server connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Asheraf authored and 4144 committed Apr 11, 2023
1 parent 11c5bab commit 32c2691
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,14 @@ static bool api_config_read_inter(const char *filename, struct config_t *config,
if (libconfig->setting_lookup_string(setting, "bind_ip", &str) == CONFIG_TRUE)
aclif->setbindip(str);

if (!api->login_ip_set) {
char ip_str[16];
sockt->ip2str(sockt->addr_[0], ip_str);
ShowInfo("Login ip not set, defaulting to %s as IP address\n", ip_str);

aloginif->setip(ip_str);
}

return true;
}

Expand Down

0 comments on commit 32c2691

Please sign in to comment.