-/* $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>
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;
{
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;