diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2011-04-27 19:16:16 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2011-04-27 19:16:16 +0000 |
commit | 44dbcedbf511995423f3c0c07e2b9ebcb0e069ff (patch) | |
tree | 103b7abd67886d3e316e25fea545e75c86b7075c /usr.sbin/iscsid/iscsid.c | |
parent | ac7f39e07313a76b128b858151b40a6f39ca11cd (diff) |
Implement CTRL_LOG_VERBOSE to toggle log verbosity.
Diffstat (limited to 'usr.sbin/iscsid/iscsid.c')
-rw-r--r-- | usr.sbin/iscsid/iscsid.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/iscsid/iscsid.c b/usr.sbin/iscsid/iscsid.c index 19aa6f9d790..fe34cf72886 100644 --- a/usr.sbin/iscsid/iscsid.c +++ b/usr.sbin/iscsid/iscsid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iscsid.c,v 1.4 2011/04/27 07:25:26 claudio Exp $ */ +/* $OpenBSD: iscsid.c,v 1.5 2011/04/27 19:16:15 claudio Exp $ */ /* * Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org> @@ -157,6 +157,7 @@ iscsid_ctrl_dispatch(void *ch, struct pdu *pdu) struct initiator_config *ic; struct session_config *sc; struct session *s; + int *valp; cmh = pdu_getbuf(pdu, NULL, 0); if (cmh == NULL) @@ -175,7 +176,7 @@ iscsid_ctrl_dispatch(void *ch, struct pdu *pdu) break; case CTRL_SESSION_CONFIG: if (cmh->len[0] != sizeof(*sc)) { - log_warnx("CTRL_INITIATOR_CONFIG bad size"); + log_warnx("CTRL_SESSION_CONFIG bad size"); control_compose(ch, CTRL_FAILURE, NULL, 0); break; } @@ -207,6 +208,16 @@ iscsid_ctrl_dispatch(void *ch, struct pdu *pdu) control_compose(ch, CTRL_SUCCESS, NULL, 0); break; + case CTRL_LOG_VERBOSE: + if (cmh->len[0] != sizeof(int)) { + log_warnx("CTRL_LOG_VERBOSE bad size"); + control_compose(ch, CTRL_FAILURE, NULL, 0); + break; + } + valp = pdu_getbuf(pdu, NULL, 1); + log_verbose(*valp); + control_compose(ch, CTRL_SUCCESS, NULL, 0); + break; default: log_warnx("unknown control message type %d", cmh->type); control_compose(ch, CTRL_FAILURE, NULL, 0); |