Commit Graph

70 Commits

Author SHA1 Message Date
trasz
19b6e68597 MFC r273543:
Clean up (refactor) discovery a little; no functional changes.

Sponsored by:	The FreeBSD Foundation
2014-11-22 17:58:39 +00:00
trasz
340f150ff8 MFC r273468:
Remove misleading statement.  Bump date.

Sponsored by:	The FreeBSD Foundation
2014-11-22 17:56:03 +00:00
trasz
c6421981a9 MFC r273466:
Remove spurious empty line.

Sponsored by:	The FreeBSD Foundation
2014-11-22 17:54:11 +00:00
trasz
4844d3d80c MFC r273465:
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
2014-11-22 17:52:33 +00:00
trasz
38906efd97 MFC r273464:
Whitespace fixes.

Sponsored by:	The FreeBSD Foundation
2014-11-22 17:50:14 +00:00
trasz
e89f2b0aad MFC r271320:
Use keys_add_int() where appropriate.  No functional changes.

Sponsored by:	The FreeBSD Foundation
2014-11-22 17:48:09 +00:00
trasz
071ca148ac MFC r273459:
Untangle iSCSI authentication code by splitting off the CHAP
implementation.

Sponsored by:	The FreeBSD Foundation
2014-11-22 17:39:39 +00:00
mav
b61a1b5706 MFC r272911:
Make ctld start even if some LUNs are unable to open backing storage.

Such LUNs will be visible to initiators, but return "not ready" status
on media access commands.  If backing storage become available later,
`ctladm modify ...` or `service ctld reload` can trigger its reopen.
2014-10-20 07:41:37 +00:00
mav
0c6538f05f MFC r271797: Make kernel to update LUN size from the backing storage
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)
2014-09-21 13:09:05 +00:00
trasz
3f933e4c16 MFC r271571:
Fix two small nits in ctl.conf(5).

Approved by:	re (glebius)
Sponsored by:	The FreeBSD Foundation
2014-09-18 11:52:28 +00:00
allanjude
ddfed1e4ee MFC r271445,r271446,r271560:
Improve markup and language throughout the ctl.conf man page

MFC r271543:
Add the new iscsi(4) man page
Cross reference it from iscsid(8) and iscsictl(8)

Approved by:	re (gjb), bcr (mentor)
2014-09-18 03:02:00 +00:00
trasz
595559f064 MFC r271319:
Fix ctld(8) to not forget to send TargetPortalGroupTag and TargetAlias
when the initiator skips security negotiation.  This fixes interoperability
with Xtend SAN initiator.

PR:		193021
Approved by:	re (marius)
Sponsored by:	The FreeBSD Foundation
2014-09-17 07:06:02 +00:00
trasz
95a8c9b2ac MFC r271187:
Avoid ctld(8) crash on getaddrinfo(3) failure.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2014-09-15 16:40:27 +00:00
trasz
0c1d52f3f7 MFC r271169:
Turn two errors, which are possible to trigger only by bugs,
into assertions.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2014-09-15 14:21:57 +00:00
trasz
17ea2e1bc5 MFC r271157:
Fix typo.

Approved by:	re (marius)
Sponsored by:	The FreeBSD Foundation
2014-09-15 14:04:55 +00:00
ngie
b13059ee32 MFC r270179:
Add missing libraries to DPADD; sort DPADD so DPADD and LDADD match up

  This fixes "make checkdpadd"

  Approved by: jmmv (mentor)
  Phabric: D630
  PR: 192765
2014-09-02 16:14:16 +00:00
trasz
bd6edcc077 MFC r270279:
Make the iSCSI stack use __FBSDID() properly.

Sponsored by:	The FreeBSD Foundation
2014-08-31 20:21:08 +00:00
mav
f3589bc4f2 MFC r269183, r269191:
Add netmasks support to initiator-portal option.
2014-08-18 16:06:04 +00:00
wblock
d357493f14 MFC 268931:
Correct spelling errors in ctld.8.  While here, correct similar errors
in ctl.conf.5 and fix a couple of contractions.
2014-07-31 14:53:07 +00:00
mav
394f34f485 MFC r268795:
Fix ctld crash on startup if target alias is not set.
2014-07-20 07:35:00 +00:00
mav
100d0f0aa6 MFC r268328:
Close race in r268291 between port destruction, delayed by sessions
teardown, and new port creation during `service ctld restart`.

Close it by returning iSCSI port internal state, that allows to identify
dying ports, which should not be counted as existing, from really alive.
2014-07-15 17:10:48 +00:00
mav
0468376762 MFC r268302:
Pass through iSCSI session ISID from LOGIN request to the CTL frontend.

ISID is an important part of initiator transport ID for iSCSI.  It is not
used now, but should be to properly implement persistent reservation.
2014-07-15 17:07:07 +00:00
mav
f1200cac15 MFC r268293:
Burry devid port method, which was a gross hack.

Instead make ports provide wanted port and target IDs, and LUNs provide
wanted LUN IDs.  After that core Device ID VPD code only had to link all
of them together and add relative port and port group numbers.

LUN ID for iSCSI LUNs no longer created by CTL, but by ctld, and passed
to CTL as "scsiname" LUN option.  This makes LUNs to report the same set
of IDs, independently from the port through which it is accessed, as
required by SCSI specifications.
2014-07-15 17:06:10 +00:00
mav
b40b547aa1 MFC r268291:
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.
2014-07-15 17:05:11 +00:00
mav
3b926638cf MFC r267648:
serial_num and device_id fields are not necessarily null-terminated.

Before this it was impossible to use all 16 bytes of serial number, and
client always got serial number NULL-terminated, that is not required.
2014-07-04 16:17:15 +00:00
mav
2b0cbbb52b MFC r267606:
On discovery stage add set of TargetAddress keys to reply, reporting to
the client all the portal groups addresses and ports.
2014-07-02 10:18:42 +00:00
jpaetzel
79ef481e2b MFC: 267833
Fix issues in config parser relating to lun serial numbers.

Without this fix some serial numbers needed to be quoted
to avoid the config parser bailing out.

Submitted by:	delphij
Sponsored by:	iXsystems
2014-06-27 17:10:28 +00:00
trasz
73fdbcd002 MFC r264877:
Style fixes.

Sponsored by:	The FreeBSD Foundation
2014-05-07 08:00:59 +00:00
trasz
4dda47a3fa MFC r264535:
English.

Sponsored by:	The FreeBSD Foundation
2014-05-07 07:44:17 +00:00
trasz
854e04966d MFC r264534:
If we fail to create LUN, try again on next configuration reload.

Sponsored by:	The FreeBSD Foundation
2014-05-07 07:43:13 +00:00
trasz
db043740d7 MFC r264533:
Use consistent punctuation.

Sponsored by:	The FreeBSD Foundation
2014-05-07 07:41:58 +00:00
trasz
25fa6ec500 MFC r264532:
Use proper terminology in debug messages.

Sponsored by:	The FreeBSD Foundation
2014-05-07 07:40:45 +00:00
trasz
4eacdf9453 MFC r264531:
Constify.

Sponsored by:	The FreeBSD Foundation
2014-05-07 07:39:16 +00:00
trasz
21ec0cf2d0 MFC r264530:
Properly pass the initiator address when running in proxy mode.

Sponsored by:	The FreeBSD Foundation
2014-05-07 07:37:55 +00:00
trasz
a59839947c MFC r264529:
Use socket address from accept(2) instead of retrieving it via
getpeername(2).

Sponsored by:	The FreeBSD Foundation
2014-05-07 07:36:46 +00:00
trasz
04b1f4adf5 MFC r264528:
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
2014-05-07 07:35:21 +00:00
trasz
f2085cbf68 MFC r264526:
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
2014-05-07 07:32:45 +00:00
trasz
690b7a7a12 MFC r264524:
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
2014-05-07 07:29:39 +00:00
trasz
7420d3ad26 MFC r264500:
Stop treating LUN 0 as mandatory.  There is no reason to do that.

Sponsored by:	The FreeBSD Foundation
2014-05-07 07:28:23 +00:00
trasz
59337a66a6 MFC r263356:
Make the error message more clear.

Sponsored by:	The FreeBSD Foundation
2014-03-25 12:38:43 +00:00
trasz
4a35e9f814 MFC r261752:
Empty data segment during Login Phase is rather unlikely, but it's
not, by itself, a protocol error.  This fixes interoperability with
OpenBSD initiator.

Sponsored by:	The FreeBSD Foundation
2014-03-25 12:33:16 +00:00
trasz
9a3c8da93d MFC r261751:
The log_whatever() routines don't accept NULL for format strings,
so mark them as __printflike instead of__printf0like.

Sponsored by:	The FreeBSD Foundation
2014-03-25 12:31:08 +00:00
trasz
b25383a8f9 MFC r261764:
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
2014-03-25 12:24:18 +00:00
trasz
5fb75e3b8f MFC r261763:
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
2014-03-25 12:22:30 +00:00
trasz
d3e539d4a4 MFC r261762:
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
2014-03-25 12:20:29 +00:00
trasz
760d220cff MFC r261761:
Update manual page to match recent auth-group "default" changes.

Sponsored by:	The FreeBSD Foundation
2014-03-25 12:18:37 +00:00
trasz
60885b6065 MFC r261760:
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
2014-03-25 12:16:52 +00:00
trasz
d57dc1f923 MFC r261759:
Make it possible to redefine portal-group "default".

Sponsored by:	The FreeBSD Foundation
2014-03-25 12:14:48 +00:00
trasz
47c8dbe543 MFC r261758:
Add auth-type.

Sponsored by:	The FreeBSD Foundation
2014-03-25 12:12:37 +00:00
trasz
b76fc2462a MFC r261757:
Rename a variable, no functional changes.

Sponsored by:	The FreeBSD Foundation
2014-03-25 12:10:30 +00:00