diff options
Diffstat (limited to 'src/dbi.c')
-rw-r--r-- | src/dbi.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -275,7 +275,7 @@ int og_dbi_get_server_ip(const struct og_dbi *dbi, const char *client_ip, bool found = false; dbi_result result; - if (inet_aton(client_ip, &client) < 0) { + if (!inet_aton(client_ip, &client)) { syslog(LOG_ERR, "failed to parse client IP (%s:%d)\n", __func__, __LINE__); return -1; @@ -300,7 +300,7 @@ int og_dbi_get_server_ip(const struct og_dbi *dbi, const char *client_ip, } netmask_ip = dbi_result_get_string(result, "netmask"); - if (inet_aton(netmask_ip, &netmask) < 0) { + if (!inet_aton(netmask_ip, &netmask)) { syslog(LOG_ERR, "failed to parse netmask (%s:%d)\n", __func__, __LINE__); dbi_result_free(result); @@ -324,7 +324,7 @@ int og_dbi_get_server_ip(const struct og_dbi *dbi, const char *client_ip, if (server_ip[0] && !first_server_ip) first_server_ip = server_ip; - if (inet_aton(server_ip, &server) < 0) { + if (!inet_aton(server_ip, &server)) { syslog(LOG_ERR, "failed to get repository IP (%s:%d)\n", __func__, __LINE__); dbi_result_free(result); @@ -369,7 +369,7 @@ int og_dbi_get_repository_ip(const struct og_dbi *dbi, const uint32_t repo_id, bool found = false; dbi_result result; - if (inet_aton(client_ip, &client) < 0) { + if (!inet_aton(client_ip, &client)) { syslog(LOG_ERR, "failed to parse client IP (%s:%d)\n", __func__, __LINE__); return -1; @@ -394,7 +394,7 @@ int og_dbi_get_repository_ip(const struct og_dbi *dbi, const uint32_t repo_id, } netmask_ip = dbi_result_get_string(result, "netmask"); - if (inet_aton(netmask_ip, &netmask) < 0) { + if (!inet_aton(netmask_ip, &netmask)) { syslog(LOG_ERR, "failed to parse netmask (%s:%d)\n", __func__, __LINE__); dbi_result_free(result); @@ -419,7 +419,7 @@ int og_dbi_get_repository_ip(const struct og_dbi *dbi, const uint32_t repo_id, if (repo_ip[0] && !first_repo_ip) first_repo_ip = repo_ip; - if (inet_aton(repo_ip, &repo) < 0) { + if (!inet_aton(repo_ip, &repo)) { syslog(LOG_ERR, "failed to get repository IP (%s:%d)\n", __func__, __LINE__); dbi_result_free(result); |