aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ctld
Commit message (Collapse)AuthorAgeFilesLines
* Advertise ctlstat(8) a little better.Edward Tomasz Napierala2015-05-221-2/+3
| | | | | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=283285
* Make setproctitle(3) work in Capsicum capability mode. This makesEdward Tomasz Napierala2015-04-271-3/+0
| | | | | | | | | | | | | | ctld(8) child processes to indicate initiator address and name in their titles, similar to what iscsid(8) child processes do. PR: 181352 Differential Revision: https://reviews.freebsd.org/D2363 Reviewed by: rwatson@, mjg@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=282086
* Add hint about "volmode=dev" to ctl.conf(5).Edward Tomasz Napierala2015-04-211-3/+9
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D2328 Reviewed by: allanjude@, bcr@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281820
* Eliminate unused headers.Xin LI2015-04-147-14/+0
| | | | Notes: svn path=/head/; revision=281532
* Make ctld to not exit on ECONNABORTED on accept().Alexander Motin2015-04-061-1/+4
| | | | | | | | | | That is not really an error for the main process. MFC after: 1 week Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=281163
* Fix thinko/copypaste error.Josh Paetzel2015-04-041-1/+1
| | | | | | | | | | | | 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. MFC after: 3 days Sponsored by: iXsystems Notes: svn path=/head/; revision=281084
* Add example configuration for FibreChannel ports.Alexander Motin2015-03-041-6/+8
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=279591
* If target name starts with "naa.", set it as WWNN for CTL port.Alexander Motin2015-03-041-1/+13
| | | | | | | | MFC after: 1 week Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=279590
* Fix handling of queued text and logout requests.Alexander Motin2015-03-041-0/+4
| | | | | | | | | | 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. MFC after: 1 week Notes: svn path=/head/; revision=279589
* Move the "offload" clause from the target section to portal-groupEdward Tomasz Napierala2015-02-286-40/+41
| | | | | | | | | | section; it makes more sense there. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=279392
* Add missing error check.Edward Tomasz Napierala2015-02-261-1/+4
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=279314
* Fix memory leak on incorrect initiator portal.Alexander Motin2015-02-251-0/+1
| | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 3 days Notes: svn path=/head/; revision=279277
* Add checks for malloc() failures.Alexander Motin2015-02-251-0/+5
| | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 3 days Notes: svn path=/head/; revision=279276
* Remove unused code.Edward Tomasz Napierala2015-02-122-21/+0
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=278622
* Add missing asprintf() status checks.Alexander Motin2015-02-111-2/+8
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=278594
* Fix formatting.Edward Tomasz Napierala2015-02-111-3/+3
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=278585
* Teach ctld(8) to control non-iSCSI CTL ports.Alexander Motin2015-02-076-72/+257
| | | | | | | | | | | | | | | | | | | 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. MFC after: 2 weeks Relnotes: yes Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=278354
* Make it possible to set (via ctl.conf(5)) and query (via ctladm islist -v)Edward Tomasz Napierala2015-02-067-11/+101
| | | | | | | | | | | | target iSCSI offload. Add mechanism to query maximum receive data segment size supported by chosen hardware offload module, and use it in ctld(8) to determine the value to advertise to the other side. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=278331
* Add support for multiple portal groups per target.Alexander Motin2015-02-067-111/+279
| | | | | | | | | | | | | | 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. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=278322
* Bring some more order into iSCSI portal group tags support.Alexander Motin2015-02-033-10/+16
| | | | | | | | | | | While ctld(8) still does not allow multiple portal groups per target to be configured, kernel should now be able to handle it. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=278161
* CTL LUN mapping rewrite.Alexander Motin2015-02-015-305/+358
| | | | | | | | | | | | | | | | | | | | | | | | 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. Discussed with: trasz MFC after: 2 weeks Relnotes: yes Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=278037
* Slightly polish iSCSI parameters negotiation.Alexander Motin2014-12-191-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=275925
* Make sequence numbers checks more strict.Alexander Motin2014-12-172-9/+9
| | | | | | | | | | | | | 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. MFC after: 2 weeks Notes: svn path=/head/; revision=275864
* Do not corrupt the listen string when parsing it.Alexander Motin2014-12-031-5/+7
| | | | | | | | | | This fixes problem with ctld reload when it is configured to listen on two portals with same IP, but different ports. MFC after: 1 week Notes: svn path=/head/; revision=275452
* Fix null pointer dereference.Edward Tomasz Napierala2014-12-021-1/+1
| | | | | | | | | MFC after: 2 weeks Coverity CID: 1256497 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=275399
* Convert usr.sbin to LIBADDBaptiste Daroussin2014-11-251-2/+1
| | | | | | | Reduce overlinking Notes: svn path=/head/; revision=275054
* Remove the pidfile clause from the ctl.conf example. Why do everyoneEdward Tomasz Napierala2014-11-241-3/+1
| | | | | | | | | | just copy/paste this line into their configs, it's beyond me. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274954
* For both iSCSI initiator and target increase socket buffer sizes beforeAlexander Motin2014-11-222-1/+12
| | | | | | | | | | | | | | 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. MFC after: 1 week Notes: svn path=/head/; revision=274853
* In conf_apply() remove iSCSI ports from kernel before removing LUNs.Alexander Motin2014-11-211-10/+10
| | | | | | | | | | | | 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. MFC after: 1 month Notes: svn path=/head/; revision=274804
* Fix error handling.Edward Tomasz Napierala2014-11-211-1/+1
| | | | | | | | | MFC after: 1 month Coverity CID: 1249768 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274797
* Add missing error checking for kernel_port_{add,remove}(). Both can failEdward Tomasz Napierala2014-11-211-3/+22
| | | | | | | | | | | for reasons yet unknown; don't make it increment cumulated_error as a kind of temporary workaround. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274791
* Make both iSCSI initiator and target support base64 encoded CHAP data.Alexander Motin2014-11-091-1/+50
| | | | | | | | | | | | While all tested initiators and targets use hex-encoded CHAP data, RFC also allows base64 encoding there, and Microsoft certificaition tool uses it. Reviewed by: trasz (earlier version) MFC after: 2 weeks Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=274328
* Add HISTORY section to ctld(8).Edward Tomasz Napierala2014-11-091-1/+6
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274310
* Fix several nits in redirection handling - don't use wrong CSG,Edward Tomasz Napierala2014-11-091-27/+14
| | | | | | | | | | and avoid use-after-free. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274309
* Add support for sending redirections to iSCSI target.Edward Tomasz Napierala2014-11-096-6/+195
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274308
* Improve wording in ctl.conf(5).Edward Tomasz Napierala2014-11-081-4/+5
| | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D1020 Reviewed by: bcr@ (earlier version), wblock@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274278
* ctld(8) doesn't require -lcam or -lssl; remove those from DPADD and LDADD.Edward Tomasz Napierala2014-11-081-2/+2
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=274277
* Remove unused assignments, noticed by Clang analyzer.Alexander Motin2014-11-071-7/+7
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=274248
* Fix iscsictl(8) and ctld(8) to correctly handle Windows newlinesEdward Tomasz Napierala2014-10-291-0/+1
| | | | | | | | | | (CRLF) in iscsi.conf and ctl.conf. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273822
* Keep the token list sorted.Edward Tomasz Napierala2014-10-291-3/+3
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273821
* Make it possible to optionally use semicolon to separate statements.Edward Tomasz Napierala2014-10-292-1/+12
| | | | | | | | | | | | | | This makes it possible to format stuff like this: target xxx { lun 0 { path /foo/bar; size 4G; } } MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273820
* Simplify code; no functional changes.Edward Tomasz Napierala2014-10-293-47/+21
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273816
* Add discovery-filter. This makes it possible to restrict which targetsEdward Tomasz Napierala2014-10-297-8/+193
| | | | | | | | | | | | are returned during discovery based on initiator portal, name, and CHAP credentials. Reviewed by: mav@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273813
* Document iSNS defaults.Edward Tomasz Napierala2014-10-281-1/+3
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273793
* Fix build after previous commit. While here, improve error messages.Edward Tomasz Napierala2014-10-281-13/+27
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273770
* Remove the distinction between strings and numbers from ctld(8) yacc parser.Edward Tomasz Napierala2014-10-282-30/+59
| | | | | | | | | | | | | This fixes problems with passing strings that look like numbers to clauses that expect strings; previously it caused syntax errors and had to be worked by user, using quotes. The workaround introduced in r267833 is no longer neccessary. MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273768
* Add basic iSNS client to the iSCSI target.Alexander Motin2014-10-258-46/+759
| | | | | | | | | | | | | | | This makes ctld(8) register its iSCSI targets and portals on configured iSNS servers to allow initiators find them without active discovery. Fetching of allowed initiators from iSNS is not implemented now, so target ACLs still should be configured manually. Reviewed by: trasz@ MFC after: 1 month Sponsored by: iXsystems, Inc. Notes: svn path=/head/; revision=273635
* Improve ctld.conf example.Edward Tomasz Napierala2014-10-241-10/+17
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273585
* Make the initiator-name and initiator-portal checks a little nicer.Edward Tomasz Napierala2014-10-243-20/+36
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273584
* Tidy up the login code; no functional changes.Edward Tomasz Napierala2014-10-241-11/+11
| | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=273583