summaryrefslogtreecommitdiffstats
path: root/usr.sbin/iscsid
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2014-04-20 20:12:31 +0000
committerclaudio <claudio@openbsd.org>2014-04-20 20:12:31 +0000
commit7bc8b37f0e768efc06bc1cc2e55c544f84d89de0 (patch)
treea590af75fe5b32c26bfff610c69fb49be7747915 /usr.sbin/iscsid
parentRestore beck's (void)snprintf(): they were reviewed. (diff)
downloadwireguard-openbsd-7bc8b37f0e768efc06bc1cc2e55c544f84d89de0.tar.xz
wireguard-openbsd-7bc8b37f0e768efc06bc1cc2e55c544f84d89de0.zip
After doing all of the loging dance to get the target's params it makes
sense to merge them into the active set. At least that way we run with the right params and finally do reads and writes that are > 8k.
Diffstat (limited to 'usr.sbin/iscsid')
-rw-r--r--usr.sbin/iscsid/connection.c3
-rw-r--r--usr.sbin/iscsid/session.c11
2 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/iscsid/connection.c b/usr.sbin/iscsid/connection.c
index d01250015b5..b8555a23a3c 100644
--- a/usr.sbin/iscsid/connection.c
+++ b/usr.sbin/iscsid/connection.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: connection.c,v 1.15 2014/04/20 18:17:12 claudio Exp $ */
+/* $OpenBSD: connection.c,v 1.16 2014/04/20 20:12:31 claudio Exp $ */
/*
* Copyright (c) 2009 Claudio Jeker <claudio@openbsd.org>
@@ -449,6 +449,7 @@ c_do_login(struct connection *c, enum c_event ev)
int
c_do_loggedin(struct connection *c, enum c_event ev)
{
+ iscsi_merge_conn_params(&c->active, &c->mine, &c->his);
session_fsm(c->session, SESS_EV_CONN_LOGGED_IN, c);
return CONN_LOGGED_IN;
diff --git a/usr.sbin/iscsid/session.c b/usr.sbin/iscsid/session.c
index d58f53a0e95..2ec59b603be 100644
--- a/usr.sbin/iscsid/session.c
+++ b/usr.sbin/iscsid/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.5 2014/04/20 16:52:11 claudio Exp $ */
+/* $OpenBSD: session.c,v 1.6 2014/04/20 20:12:31 claudio Exp $ */
/*
* Copyright (c) 2011 Claudio Jeker <claudio@openbsd.org>
@@ -297,10 +297,13 @@ sess_do_conn_loggedin(struct session *s, struct sessev *sev)
if (s->state & SESS_LOGGED_IN)
return SESS_LOGGED_IN;
- if (s->config.SessionType == SESSION_TYPE_DISCOVERY)
+ if (s->config.SessionType == SESSION_TYPE_DISCOVERY) {
initiator_discovery(s);
- else
- vscsi_event(VSCSI_REQPROBE, s->target, -1);
+ return SESS_LOGGED_IN;
+ }
+
+ iscsi_merge_sess_params(&s->active, &s->mine, &s->his);
+ vscsi_event(VSCSI_REQPROBE, s->target, -1);
return SESS_LOGGED_IN;
}