summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctld/ctld.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r326276:eadler2018-03-051-0/+2
| | | | | | | | | | | | | | | | various: general adoption of SPDX licensing ID tags. Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended.
* MFC r316677: Do not register in CTL portal groups without portals.mav2017-04-241-5/+17
| | | | | | From config synthax point of view such portal groups are not incorrect, but they are useless since can not receive any connection. And since CTL port resource is very limited, it is good to save it.
* MFC r309241,309243:delphij2016-12-121-1/+4
| | | | Plug memory leaks.
* MFC r308133, r308134: Fix wrong copy/paste in error message.mav2016-11-141-2/+2
|
* MFC r302503:trasz2016-07-121-1/+1
| | | | | | | Fix ctld(8) to not exit when reloading configuration with invalid initiator-portal clause. Approved by: re (gjb)
* Make the usage() mention the -u option added in r295212.trasz2016-04-121-1/+1
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Add an additional, libucl-based configuration file parser to ctld.jceel2016-02-031-3/+109
| | | | | | | | | | | | Default ctld behavior remains unchanged - libucl parser can be selected explicitly by adding -u switch to ctld command line. Reviewed by: trasz Approved by: trasz (mentor) MFC after: 1 month Relnotes: yes Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D4534
* Introduce portal group options in ctl.conf.mav2015-11-091-35/+36
| | | | | | While CTL has concept of port options, used at least for iSCSI ports now, before this change it was impossible to set them manually. There still no user-configurable port options now, but I am planning to change that.
* Fix a ton of speelling errorseadler2015-10-211-1/+1
| | | | | | | arc lint is helpful Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com Differential Revision: https://reviews.freebsd.org/D3337
* Set default block size for CD to expected 2048 bytes.mav2015-10-021-1/+4
|
* Add to CTL initial support for CDROMs and removable devices.mav2015-09-271-0/+7
| | | | Relnotes: yes
* Fix typo.jpaetzel2015-09-251-1/+1
| | | | Sponsored by: iXsystems
* Add ctl-lun config option for consistency in HA setups.mav2015-09-151-0/+1
|
* When updating port, apply only change of LUN map, not whole.mav2015-09-131-1/+1
|
* Add two new portal group options "tag" and "foreign".mav2015-09-071-5/+16
| | | | They are going to be useful in clustered setups.
* Allow LUN options modification via CTL_LUNREQ_MODIFY.mav2015-09-061-11/+7
| | | | Not all changes take effect, but that is a different question.
* Make ctld to not exit on ECONNABORTED on accept().mav2015-04-061-1/+4
| | | | | | | That is not really an error for the main process. MFC after: 1 week Sponsored by: iXsystems, Inc.
* Fix thinko/copypaste error.jpaetzel2015-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
* Move the "offload" clause from the target section to portal-grouptrasz2015-02-281-18/+17
| | | | | | | section; it makes more sense there. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Fix memory leak on incorrect initiator portal.mav2015-02-251-0/+1
| | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 3 days
* Add missing asprintf() status checks.mav2015-02-111-2/+8
| | | | MFC after: 2 weeks
* Teach ctld(8) to control non-iSCSI CTL ports.mav2015-02-071-8/+93
| | | | | | | | | | | | | | | | 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.
* Make it possible to set (via ctl.conf(5)) and query (via ctladm islist -v)trasz2015-02-061-0/+18
| | | | | | | | | 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
* Add support for multiple portal groups per target.mav2015-02-061-46/+116
| | | | | | | | | | | 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.
* Bring some more order into iSCSI portal group tags support.mav2015-02-031-3/+14
| | | | | | | | 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.
* CTL LUN mapping rewrite.mav2015-02-011-213/+197
| | | | | | | | | | | | | | | | | | | | | 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.
* Do not corrupt the listen string when parsing it.mav2014-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
* Fix null pointer dereference.trasz2014-12-021-1/+1
| | | | | | MFC after: 2 weeks Coverity CID: 1256497 Sponsored by: The FreeBSD Foundation
* For both iSCSI initiator and target increase socket buffer sizes beforemav2014-11-221-1/+11
| | | | | | | | | | | 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
* In conf_apply() remove iSCSI ports from kernel before removing LUNs.mav2014-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
* Add missing error checking for kernel_port_{add,remove}(). Both can failtrasz2014-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
* Add support for sending redirections to iSCSI target.trasz2014-11-091-4/+52
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Remove unused assignments, noticed by Clang analyzer.mav2014-11-071-7/+7
| | | | MFC after: 1 week
* Simplify code; no functional changes.trasz2014-10-291-42/+16
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Add discovery-filter. This makes it possible to restrict which targetstrasz2014-10-291-0/+50
| | | | | | | | | are returned during discovery based on initiator portal, name, and CHAP credentials. Reviewed by: mav@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Add basic iSNS client to the iSCSI target.mav2014-10-251-44/+349
| | | | | | | | | | | | 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.
* Make the initiator-name and initiator-portal checks a little nicer.trasz2014-10-241-0/+25
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Fix ctld(8) to not show the "auth-group <name> not assigned to any target"trasz2014-10-221-6/+15
| | | | | | | warning for auth-groups assigned to a portal-group. MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Whitespace fixes.trasz2014-10-221-6/+6
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Make kernel to update LUN size from the backing storage on configurationmav2014-09-181-1/+2
| | | | | | | | reload also if that size was not specified in the new configuration. Previously it happened only if size was explicitly changed in config. MFC after: 3 days
* Avoid ctld(8) crash on getaddrinfo(3) failure.trasz2014-09-061-9/+7
| | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* Turn two errors, which are possible to trigger only by bugs,trasz2014-09-051-7/+3
| | | | | | | | into assertions. Discussed with: mav@ MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* Make the iSCSI stack use __FBSDID() properly.trasz2014-08-211-1/+3
| | | | | MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
* Fix r269183 build woth GCC.mav2014-07-281-5/+10
| | | | MFC after: 2 weeks
* Add netmasks support to initiator-portal option.mav2014-07-281-12/+84
| | | | MFC after: 2 weeks
* Create separate CTL port for every iSCSI target (and maybe portal group).mav2014-07-051-14/+3
| | | | | | | | | | | | | | | Having single port for all iSCSI connections makes problematic implementing some more advanced SCSI functionality in CTL, that require proper ports enumeration and identification. This change extends CTL iSCSI API, making ctld daemon to control list of iSCSI ports in CTL. When new target is defined in config fine, ctld will create respective port in CTL. When target is removed -- port will be also removed after all active commands through that port properly aborted. This change require ctld to be rebuilt to match the kernel. As a minor side effect, this allows to have iSCSI targets without LUNs. While that may look odd and not very useful, that is not incorrect.
* English.trasz2014-04-161-3/+3
| | | | Sponsored by: The FreeBSD Foundation
* If we fail to create LUN, try again on next configuration reload.trasz2014-04-161-1/+9
| | | | Sponsored by: The FreeBSD Foundation
* Use consistent punctuation.trasz2014-04-161-3/+4
| | | | Sponsored by: The FreeBSD Foundation
* Constify.trasz2014-04-161-5/+5
| | | | Sponsored by: The FreeBSD Foundation
OpenPOWER on IntegriCloud