[Swan] an xauth logging message
D. Hugh Redelmeier
hugh at mimosa.com
Fri Mar 1 07:27:26 EET 2013
Paul sees some surprising logging. So I'm staring at the code. In
particular (shifted left for readability):
DBG(DBG_CONTROLMORE , DBG_log("this is a xauthserver=%s "
"xauthclient=%s modecfgserver=%s "
"modecfgclient=%s in sate %s. "
"reply with UNSUPPORTED_EXCHANGE_TYPE"
, st->st_connection->spd.this.xauth_server ? "yes" : "no"
, st->st_connection->spd.this.xauth_client ? "yes" : "no"
, st->st_connection->spd.this.modecfg_server ? "yes" : "no"
, st->st_connection->spd.this.modecfg_client ? "yes" : "no"
, enum_name(&state_names, st->st_state)
));
Spelling: "sate" =>"state".
Are xauth_server and xauth_client mutually exclusive?
Are modecfg_server and modecfg_client mutually exclusive?
If so, perhaps a PASSERT and a simpler message is in order.
Assuming all are independent, I think that this generates a simpler
message:
DBG(DBG_CONTROLMORE , DBG_log("this is a%s%s%s%s in state %s. "
"Reply with UNSUPPORTED_EXCHANGE_TYPE"
, st->st_connection->spd.this.xauth_server ? " xauthserver" : ""
, st->st_connection->spd.this.xauth_client ? " xauthclient" : ""
, st->st_connection->spd.this.modecfg_server ? " modecfgserver" : ""
, st->st_connection->spd.this.modecfg_client ? " modecfgclient" : ""
, enum_name(&state_names, st->st_state)
));
Admittedly, this looks funny if none of the fields is true, but I
would guess this never happens. Am I wrong?
More information about the Swan
mailing list