Commit Graph

132 Commits

Author SHA1 Message Date
mav
5a4270f056 MFC r288486, r288488: Set default block size for CD to expected 2048 bytes. 2015-10-05 11:51:13 +00:00
mav
3e85febb12 MFC r288310: Add to CTL initial support for CDROMs and removable devices.
Relnotes:       yes
2015-10-05 11:30:18 +00:00
mav
4d9db975e6 MFC r288259: Remove some duplicate, legacy, dead and questionable code. 2015-10-05 11:25:48 +00:00
mav
cb104e59be MFC r288061: Make cltd ignore HA ports. 2015-10-05 10:49:47 +00:00
mav
d74ee723c9 MFC r287823: Add ctl-lun config option for consistency in HA setups. 2015-10-05 09:22:31 +00:00
mav
048cd8404d MFC r287766: Add negotiation of iSCSIProtocolLevel to 2 (RFC7144).
We may need to pass negotiated value to kernel level, but so far it is
not necessary, since it does not use any new features without request.
2015-10-05 09:16:01 +00:00
mav
a0bb28fd76 MFC r287757: When updating port, apply only change of LUN map, not whole. 2015-10-05 09:11:46 +00:00
mav
f1a03e38c5 MFC r287534: Add two new portal group options "tag" and "foreign".
They are going to be useful in clustered setups.
2015-10-05 08:54:02 +00:00
mav
3f61db5756 MFC r287500: Allow LUN options modification via CTL_LUNREQ_MODIFY.
Not all changes take effect, but that is a different question.
2015-10-05 08:52:37 +00:00
mav
158f0406b0 MFC r287455, r287458, r287459: Remove some dead code. 2015-10-05 08:50:15 +00:00
mav
656a5c3136 MFC r286806: Drop "internal" CTL frontend.
Its idea was to be a simple initiator and execute several commands from
kernel level, but FreeBSD never had consumer for that functionality,
while its implementation polluted many unrelated places.
2015-10-05 08:42:43 +00:00
mav
64e021919b MFC r281532 (by delphij): Eliminate unused headers. 2015-10-05 07:42:05 +00:00
mav
f3e1fd582e MFC r279314 (by trasz): Add missing error check. 2015-10-05 07:33:54 +00:00
mav
f7a8b2b7ad MFC r278622 (by trasz): Remove unused code. 2015-10-05 07:31:51 +00:00
jpaetzel
ca4140311b MFC 288208
Fix typo.

Sponsored by:	iXsystems
2015-09-25 03:54:10 +00:00
mav
170343c951 MFC r286462: Refactor early stages of security negotiation. 2015-08-22 16:59:27 +00:00
mav
69ac9bf2f9 MFC r286456: Remove some code duplication. 2015-08-15 11:08:30 +00:00
trasz
a0b545acc6 MFC r282086:
Make setproctitle(3) work in Capsicum capability mode.  This makes
ctld(8) child processes to indicate initiator address and name in
their titles, similar to what iscsid(8) child processes do.

PR:		181352
Sponsored by:	The FreeBSD Foundation
2015-08-03 08:04:31 +00:00
trasz
8c8a81ecdf MFC r284542:
Allow '@' in unquoted strings, such as with the "path" statement.  Note
that one can use any character they like by using double quotes.

PR:		200895
Sponsored by:	The FreeBDS Foundation
2015-08-03 07:28:23 +00:00
trasz
5e028ab6e6 MFC r285086:
Remove OpenSSL dependency from iscsid(8) and ctld(8).

Sponsored by:	The FreeBSD Foundation
2015-08-03 07:20:33 +00:00
mav
5c19f61c8d MFC r284765, r284875:
Teach ctld about CTL's physical_port and virtual_port fields.

This allows ctld to work with isp(4) virtual ports, specifying them as
isp0/1, isp0/2, etc.  There are still problems on isp(4) layer with
disabling those ports after enabling, but hopefully they can be fixed.
2015-06-28 09:41:10 +00:00
trasz
88bb9f05c4 MFC r283285:
Advertise ctlstat(8) a little better.

Sponsored by:	The FreeBSD Foundation
2015-06-21 06:54:54 +00:00
trasz
c2390610a5 MFC r281820:
Add hint about "volmode=dev" to ctl.conf(5).

Sponsored by:	The FreeBSD Foundation
2015-06-20 15:55:53 +00:00
mav
66d912b92f MFC r281163: Make ctld to not exit on ECONNABORTED on accept().
That is not really an error for the main process.
2015-04-13 09:18:56 +00:00
jpaetzel
a4b9ad469d MFC 281084
Fix thinko/copypaste error.

When checking the length of the mutual secret password the variable for
the secret password was used by mistake.  This resulted in ctld never
warning about the length of the mutual secret being wrong even if it was.

Sponsored by:	iXsystems
2015-04-07 04:21:36 +00:00
rwatson
bcbbcda0f2 Merge an applicable subset of r263234 from HEAD to stable/10:
Update most userspace consumers of capability.h to use capsicum.h instead.

  auditdistd is not updated as I will make the change upstream and then do a
  vendor import sometime in the next week or two.

Note that a significant fraction does not apply, as FreeBSD 10 doesn't
contain a Capsicumised ping, casperd, libcasper, etc.  When these features
are merged, the capsicum.h change will need to be merged with them.

Sponsored by:	Google, Inc.
2015-03-19 12:32:48 +00:00
mav
6e2bec33ec MFC r279591: Add example configuration for FibreChannel ports. 2015-03-11 09:54:03 +00:00
mav
6cffa62fef MFC r279590: If target name starts with "naa.", set it as WWNN for CTL port. 2015-03-11 09:52:54 +00:00
mav
bb2d9174ab MFC r279589: Fix handling of queued text and logout requests.
While it may have little sense, text and logout requests can be queued.
If they are, they consume cmdsn, so we should increment our conn_cmdsn.
2015-03-11 09:51:53 +00:00
mav
8882db8870 MFC r279276: Add checks for malloc() failures.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-03-01 09:29:59 +00:00
mav
47c76cda56 MFC r279277: Fix memory leak on incorrect initiator portal.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-03-01 09:28:39 +00:00
mav
466f8525b0 MFC r278594: Add missing asprintf() status checks. 2015-02-20 17:10:46 +00:00
mav
e153ed8e1a MFC r278354: Teach ctld(8) to control non-iSCSI CTL ports.
This change introduces new target option "port", that assigns current target
to specified CTL port.  On config application ctld(8) will apply LUN mapping
according to target configuration to specified port and bring the port up.
On shutdown cltd(8) will remove the mapping and put the port down.

This change allows to configure both iSCSI and FibreChannel targets in the
same configuration file in alike way.

Kernel side support was added earlier at r278037.

Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2015-02-20 17:09:49 +00:00
mav
fa723dd3f0 MFC r278322: Add support for multiple portal groups per target.
This change allows multiple "portal-group" options to be specified per
target.  Each of them may include new optional auth-group name parameter
to override per-target auth parameters for specific portal group.

Kernel side support was added earlier at r278161.

Sponsored by:	iXsystems, Inc.
2015-02-19 14:52:01 +00:00
mav
2116079c78 MFC r278161: Bring some more order into iSCSI portal group tags support.
While ctld(8) still does not allow multiple portal groups per target
to be configured, kernel should now be able to handle it.

Sponsored by:	iXsystems, Inc.
2015-02-19 14:33:46 +00:00
mav
aa6a7df89f MFC r278037: CTL LUN mapping rewrite.
Replace iSCSI-specific LUN mapping mechanism with new one, working for any
ports.  By default all ports are created without LUN mapping, exposing all
CTL LUNs as before.  But, if needed, LUN mapping can be manually set on
per-port basis via ctladm.  For its iSCSI ports ctld does it via ioctl(2).
The next step will be to teach ctld to work with FibreChannel ports also.

Respecting additional flexibility of the new mechanism, ctl.conf now allows
alternative syntax for LUN definition.  LUNs can now be defined in global
context, and then referenced from targets by unique name, as needed.  It
allows same LUN to be exposed several times via multiple targets.

While there, increase limit for LUNs per target in ctld from 256 to 1024.
Some initiators do not support LUNs above 255, but that is not our problem.

Relnotes:	yes
Sponsored by:	iXsystems, Inc.
2015-02-19 14:31:16 +00:00
mav
31fb601bdc MFC r274853:
For both iSCSI initiator and target increase socket buffer sizes before
establishing connection.

This is a workaround for Chelsio TOE driver, that does not update socket
buffer size in hardware after connection established, and unless that is
done beforehand, kernel code will stuck, attempting to send/receive full
PDU at once.
2015-02-19 14:28:47 +00:00
mav
4d95d689f3 MFC r274804:
In conf_apply() remove iSCSI ports from kernel before removing LUNs.

Previous order confused initiators with messages about "removed" LUNs
during simple ctld restart without any real config change.  After this
commit initiators only reestablish lost connection, receive "Power on
occurred" UNIT ATTENTION status and continue normal operation.
2015-02-19 14:26:49 +00:00
trasz
13678d19f2 MFC r274791:
Add missing error checking for kernel_port_{add,remove}().  Both can fail
for reasons yet unknown; don't make it increment cumulated_error as a kind
of temporary workaround.

MFC r275399:

Fix null pointer dereference.

Sponsored by:	The FreeBSD Foundation
2015-01-26 13:21:30 +00:00
mav
2952feb3ad MFC r275864: Make sequence numbers checks more strict.
While we don't support MCS, hole in received sequence numbers may mean
only PDU loss.  While we don't support lost PDU recovery, terminate the
connection to avoid stuck commands.

While there, improve handling of sequence numbers wrap after 2^32 PDUs.
2015-01-03 13:08:08 +00:00
trasz
8a977bdac7 MFC r274954:
Remove the pidfile clause from the ctl.conf example.  Why do everyone
just copy/paste this line into their configs, it's beyond me.

Sponsored by:	The FreeBSD Foundation
2015-01-01 15:45:22 +00:00
mav
270e05ae8c MFC r275925: Slightly polish iSCSI parameters negotiation. 2014-12-26 09:12:19 +00:00
mav
43c3b12592 MFC r275452: Do not corrupt the listen string when parsing it.
This fixes problem with ctld reload when it is configured to listen on two
portals with same IP, but different ports.
2014-12-10 08:53:41 +00:00
trasz
c131c42ed7 MFC r274310:
Add HISTORY section to ctld(8).

Sponsored by:	The FreeBSD Foundation
2014-12-09 11:52:36 +00:00
trasz
35a0788239 MFC r274308:
Add support for sending redirections to iSCSI target.

MFC r274309:

Fix several nits in redirection handling - don't use wrong CSG,
and avoid use-after-free.

Sponsored by:	The FreeBSD Foundation
2014-12-09 11:50:50 +00:00
trasz
379a1af59c MFC r274277:
ctld(8) doesn't require -lcam or -lssl; remove those from DPADD and LDADD.

Sponsored by:	The FreeBSD Foundation
2014-12-08 11:28:08 +00:00
mav
19732a0540 MFC r274248: Remove unused assignments, noticed by Clang analyzer. 2014-12-05 07:29:31 +00:00
trasz
1fc4976104 MFC r274278:
Improve wording in ctl.conf(5).

Sponsored by:	The FreeBSD Foundation
2014-11-29 16:01:44 +00:00
trasz
59965706b2 MFC r273822:
Fix iscsictl(8) and ctld(8) to correctly handle Windows newlines
(CRLF) in iscsi.conf and ctl.conf.

Sponsored by:	The FreeBSD Foundation
2014-11-29 15:39:31 +00:00
trasz
00cfd4605b MFC r273821:
Keep the token list sorted.

Sponsored by:	The FreeBSD Foundation
2014-11-29 15:37:51 +00:00