summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvenaas <venaas>2008-02-25 10:41:20 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-02-25 10:41:20 +0000
commit3f96acb665602773de20f9e03ca1cb44e4d82f0d (patch)
tree7f3d209967461378e77edad776fccf5141eb2192
parent1b147faa3975dc259abb2fc8c8d398ed44c4b01f (diff)
max logging not crash when resolvepeer fails
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@217 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r--radsecproxy.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index f6cbaa1..c0e5422 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -187,7 +187,7 @@ int resolvepeer(struct clsrvconf *conf, int ai_flags) {
if (slash)
hints.ai_flags |= AI_NUMERICHOST;
if (getaddrinfo(conf->host, conf->port, &hints, &addrinfo)) {
- debug(DBG_WARN, "resolvepeer: can't resolve %s port %s", conf->host, conf->port);
+ debug(DBG_WARN, "resolvepeer: can't resolve %s port %s", conf->host ? conf->host : "(null)", conf->port ? conf->port : "(null)");
return 0;
}
if (slash) {
@@ -299,7 +299,7 @@ struct clsrvconf *resolve_hostport(char type, char *lconf, char *default_port) {
} else
conf->port = default_port ? stringcopy(default_port, 0) : NULL;
if (!resolvepeer(conf, AI_PASSIVE))
- debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host, conf->port);
+ debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host ? conf->host : "(null)", conf->port ? conf->port : "(null)");
return conf;
}
@@ -2577,7 +2577,7 @@ void confclient_cb(struct gconffile **cf, char *block, char *opt, char *val) {
}
if (!resolvepeer(conf, 0))
- debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host, conf->port);
+ debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host ? conf->host : "(null)", conf->port ? conf->port : "(null)");
if (!conf->secret) {
if (conf->type == 'U')
@@ -2636,7 +2636,7 @@ void confserver_cb(struct gconffile **cf, char *block, char *opt, char *val) {
free(matchcertattr);
if (!resolvepeer(conf, 0))
- debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host, conf->port);
+ debugx(1, DBG_ERR, "failed to resolve host %s port %s, exiting", conf->host ? conf->host : "(null)", conf->port ? conf->port : "(null)");
if (!conf->secret) {
if (conf->type == 'U')