summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctld/ctld.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r289677:bdrewery2016-01-071-1/+1
| | | | Fix a ton of speelling errors
* MFC r290615: Introduce portal group options in ctl.conf.mav2015-11-271-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.
* MFC r288486, r288488: Set default block size for CD to expected 2048 bytes.mav2015-10-051-1/+4
|
* MFC r288310: Add to CTL initial support for CDROMs and removable devices.mav2015-10-051-0/+7
| | | | Relnotes: yes
* MFC r287823: Add ctl-lun config option for consistency in HA setups.mav2015-10-051-0/+1
|
* MFC r287757: When updating port, apply only change of LUN map, not whole.mav2015-10-051-1/+1
|
* MFC r287534: Add two new portal group options "tag" and "foreign".mav2015-10-051-5/+16
| | | | They are going to be useful in clustered setups.
* MFC r287500: Allow LUN options modification via CTL_LUNREQ_MODIFY.mav2015-10-051-11/+7
| | | | Not all changes take effect, but that is a different question.
* MFC 288208jpaetzel2015-09-251-1/+1
| | | | | | Fix typo. Sponsored by: iXsystems
* MFC r281163: Make ctld to not exit on ECONNABORTED on accept().mav2015-04-131-1/+4
| | | | That is not really an error for the main process.
* MFC 281084jpaetzel2015-04-071-1/+1
| | | | | | | | | | 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
* MFC r279277: Fix memory leak on incorrect initiator portal.mav2015-03-011-0/+1
| | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
* MFC r278594: Add missing asprintf() status checks.mav2015-02-201-2/+8
|
* MFC r278354: Teach ctld(8) to control non-iSCSI CTL ports.mav2015-02-201-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. Relnotes: yes Sponsored by: iXsystems, Inc.
* MFC r278322: Add support for multiple portal groups per target.mav2015-02-191-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. Sponsored by: iXsystems, Inc.
* MFC r278161: Bring some more order into iSCSI portal group tags support.mav2015-02-191-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. Sponsored by: iXsystems, Inc.
* MFC r278037: CTL LUN mapping rewrite.mav2015-02-191-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. Relnotes: yes Sponsored by: iXsystems, Inc.
* MFC r274853:mav2015-02-191-1/+11
| | | | | | | | | | 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.
* MFC r274804:mav2015-02-191-10/+10
| | | | | | | | | 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.
* MFC r274791:trasz2015-01-261-3/+22
| | | | | | | | | | | | 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
* MFC r275452: Do not corrupt the listen string when parsing it.mav2014-12-101-5/+7
| | | | | This fixes problem with ctld reload when it is configured to listen on two portals with same IP, but different ports.
* MFC r274308:trasz2014-12-091-4/+52
| | | | | | | | | | | 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
* MFC r274248: Remove unused assignments, noticed by Clang analyzer.mav2014-12-051-7/+7
|
* MFC r273816:trasz2014-11-291-42/+16
| | | | | | Simplify code; no functional changes. Sponsored by: The FreeBSD Foundation
* MFC r273813:trasz2014-11-291-0/+50
| | | | | | Add discovery-filter. This makes it possible to restrict which targets are returned during discovery based on initiator portal, name, and CHAP credentials.
* MFC r273584:trasz2014-11-241-0/+25
| | | | | | Make the initiator-name and initiator-portal checks a little nicer. Sponsored by: The FreeBSD Foundation
* MFC r273635, r273793, r274797: Add basic iSNS client to the iSCSI target.mav2014-11-241-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. Relnotes: Yes Sponsored by: iXsystems, Inc.
* MFC r273465:trasz2014-11-221-6/+15
| | | | | | | Fix ctld(8) to not show the "auth-group <name> not assigned to any target" warning for auth-groups assigned to a portal-group. Sponsored by: The FreeBSD Foundation
* MFC r273464:trasz2014-11-221-6/+6
| | | | | | Whitespace fixes. Sponsored by: The FreeBSD Foundation
* MFC r271797: Make kernel to update LUN size from the backing storagemav2014-09-211-1/+2
| | | | | | | | | on configuration reload also if that size was not specified in the new configuration. Previously it happened only if size was explicitly changed in config. Approved by: re (delphij)
* MFC r271187:trasz2014-09-151-9/+7
| | | | | | | Avoid ctld(8) crash on getaddrinfo(3) failure. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation
* MFC r271169:trasz2014-09-151-7/+3
| | | | | | | | Turn two errors, which are possible to trigger only by bugs, into assertions. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation
* MFC r270279:trasz2014-08-311-1/+3
| | | | | | Make the iSCSI stack use __FBSDID() properly. Sponsored by: The FreeBSD Foundation
* MFC r269183, r269191:mav2014-08-181-12/+89
| | | | Add netmasks support to initiator-portal option.
* MFC r268291:mav2014-07-151-14/+3
| | | | | | | | | | | | | | | | | Create separate CTL port for every iSCSI target (and maybe portal group). 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.
* MFC r264535:trasz2014-05-071-3/+3
| | | | | | English. Sponsored by: The FreeBSD Foundation
* MFC r264534:trasz2014-05-071-1/+9
| | | | | | If we fail to create LUN, try again on next configuration reload. Sponsored by: The FreeBSD Foundation
* MFC r264533:trasz2014-05-071-3/+4
| | | | | | Use consistent punctuation. Sponsored by: The FreeBSD Foundation
* MFC r264531:trasz2014-05-071-5/+5
| | | | | | Constify. Sponsored by: The FreeBSD Foundation
* MFC r264530:trasz2014-05-071-26/+19
| | | | | | Properly pass the initiator address when running in proxy mode. Sponsored by: The FreeBSD Foundation
* MFC r264529:trasz2014-05-071-11/+13
| | | | | | | Use socket address from accept(2) instead of retrieving it via getpeername(2). Sponsored by: The FreeBSD Foundation
* MFC r264528:trasz2014-05-071-8/+13
| | | | | | | | | | | | Rework the way we enable CTL iSCSI port. Previously conf_apply() needed it to be already enabled, because listening in proxy mode requires it; however, it's conf_apply() that opens pidfiles, so it resulted in port being enabled before pidfile was opened. This was not so bad, but it was also disabled when pidfile couldn't be opened due to ctld already running; this means that starting second ctld instance screwed up the first. Sponsored by: The FreeBSD Foundation
* MFC r264526:trasz2014-05-071-11/+22
| | | | | | | Properly identify target portal when running in proxy mode. While here, remove CTL_ISCSI_CLOSE, it wasn't used or implemented anyway. Sponsored by: The FreeBSD Foundation
* MFC r264524:trasz2014-05-071-78/+77
| | | | | | | | Make it possible for the iSCSI target side to operate in both normal and ICL_KERNEL_PROXY mode, and fix some bit rot so the latter actually works again. Sponsored by: The FreeBSD Foundation
* MFC r264500:trasz2014-05-071-7/+6
| | | | | | Stop treating LUN 0 as mandatory. There is no reason to do that. Sponsored by: The FreeBSD Foundation
* MFC r261764:trasz2014-03-251-0/+16
| | | | | | | | | So, it turns out SIGCHLD is discarded by default, so we have to set up a dummy handler to make it interrupt an ioctl(2) or select(2). This makes those short-lived ctld(8) zombies disappear. Sponsored by: The FreeBSD Foundation
* MFC r261763:trasz2014-03-251-0/+2
| | | | | | | Use new auth-type "deny" instead of using "chap" with no chap entries; it's cleaner this way, and gives better feedback to the user. Sponsored by: The FreeBSD Foundation
* MFC r261762:trasz2014-03-251-1/+2
| | | | | | | | Use "default" as default discovery-auth-group, instead of "no-access". It doesn't change visible behaviour, as previously auth-group "default" wasn't redefinable, so by default access was always denied. Sponsored by: The FreeBSD Foundation
* MFC r261760:trasz2014-03-251-4/+3
| | | | | | | | Add a new auth-group "default", defaulting to deny, and make it possible to redefine it. From now on, assigning auth-group to a target is no longer mandatory. Sponsored by: The FreeBSD Foundation
* MFC r261758:trasz2014-03-251-0/+52
| | | | | | Add auth-type. Sponsored by: The FreeBSD Foundation
OpenPOWER on IntegriCloud