summaryrefslogtreecommitdiff
path: root/usr.sbin/iscsid
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2014-04-20 16:52:12 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2014-04-20 16:52:12 +0000
commitd913983159a000932c1901c7c3215bdd7cec5e16 (patch)
tree7a445aaf8d58d8ee1ef2bec6361e87b3188d2345 /usr.sbin/iscsid
parentd6649b60ee363e8ca05fe19f581df746b73ca0bd (diff)
Move session params initialization to when we start a session and not
when it is created. That way the config params from the config file have a chance to stick.
Diffstat (limited to 'usr.sbin/iscsid')
-rw-r--r--usr.sbin/iscsid/session.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.sbin/iscsid/session.c b/usr.sbin/iscsid/session.c
index d25fb7b83e7..d58f53a0e95 100644
--- a/usr.sbin/iscsid/session.c
+++ b/usr.sbin/iscsid/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.4 2011/05/04 21:00:04 claudio Exp $ */
+/* $OpenBSD: session.c,v 1.5 2014/04/20 16:52:11 claudio Exp $ */
/*
* Copyright (c) 2011 Claudio Jeker <claudio@openbsd.org>
@@ -72,10 +72,6 @@ session_new(struct initiator *i, u_int8_t st)
s->itt = arc4random();
s->initiator = i;
s->state = SESS_INIT;
- s->mine = initiator_sess_defaults;
- s->mine.MaxConnections = s->config.MaxConnections;
- s->his = iscsi_sess_defaults;
- s->active = iscsi_sess_defaults;
if (st == SESSION_TYPE_DISCOVERY)
s->target = 0;
@@ -281,6 +277,15 @@ sess_do_start(struct session *s, struct sessev *sev)
{
log_debug("new connection to %s",
log_sockaddr(&s->config.connection.TargetAddr));
+
+ /* initialize the session params */
+ s->mine = initiator_sess_defaults;
+ s->his = iscsi_sess_defaults;
+ s->active = iscsi_sess_defaults;
+
+ if (s->config.MaxConnections)
+ s->mine.MaxConnections = s->config.MaxConnections;
+
conn_new(s, &s->config.connection);
return SESS_FREE;