iscsinl
iscsinl copied to clipboard
Refactor Login sequence
When trying to get this to work with the iSCSI target provided by RHEL8, I found three issues with the Login sequence:
- we re-transmit parameters. this is an RFC violation (and some targets really don't like it);
- we don't interpret the three basic param responses. There's a catch for Reject, but not NotUnderstood or Irrelevant. If we get a NotUnderstood we generally try to decode it as, say, an Int, and fail (note: we get lots of NotUnderstoods due to 1);
- we have no mechanism to handle requests the target makes of us, which can cause login to fail for trivial reasons.
I handled these three by:
- Using a param queue to control which params have been sent, and dynamically add params that are needed.
- Adding some very basic handling for NotUnderstood and Irrelevant (basically, just ignore them and print a message).
- If we get a param request from the target, blindly mirror it back to accept it (probably not the best long-term strategy, but seems to work).
With these changes, I was able to mount a RHEL8 target.