Hosts under test:
- FreeBSD 13/14 with ctld
- KVM/qemu virtual machines connected by iscsi to FreeBSD hosts
The libiscsi uses 2 bytes for LUN addressing:
On other hand, FreeBSD CAM is compliant with SCSI Architecture model 5 (item 4.7)
These 2 formats of LUN addressing are not compatible in general. It works under conditions:
- If LUN number is less than 256, libiscsi works fine with FreeBSD iscsi host.
- If LUN number is equal or more than 256, FreeBSD can't retrieve LUN number sent by libiscsi.
This patch is minimal changes to handle libiscsi LUNs higher than 256.
We will appreciate if patch will be accepted. If not, please advise how to implement correctly.