Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach PGT for each PG Portal, set PGT as NULL explicily for not-allo… #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dingjs1421
Copy link

…wed portals.

According to RFC4171, an entity may have multiple Portals, each Portal
consists of its IP address and port. Besides each PG (portal group)
follows by its own PG IP addresses and TCP/UDP ports.
In order for a Portal to provide access to an iSCSI Node, the PGT
of the PG object MUST be non-NULL. If the PGT value registered for
a specified Portal and iSCSI Node is NULL, or if no PGT value is registered,
then the Portal does not provide access to that iSCSI Node in the Entity.

So PGT is a selector, that controls from which portal iSCSI Node
is allowed to access. The current implementation attachs a default
PGT with value of 0x00000001 at the end of each iSCSI target,
means each iSCSI target is allowed to access from all portals
ignoring np config in iSCSI target.

For example: a host has two interfaces :
eth0:192.168.1.10/255.255.255.0
eth1:10.40.1.20/255.255.255.0
Also has two iSCSI targets:
target 1: iqn.1994-11.com.netgear:nas-e7-5b-4c:0e261f2a:group1, np is set as 192.168.1.10:3260.
target 2: iqn.1994-11.com.netgear:nas-e7-5b-4c:0e261f2a:group1, np is set as 10.40.1.20:3260.

Obviously target 1 is allowed to access from eth0 and target 2 is only from eth1.
While currebt target-isns notifies iSNS server target1 and target 2 can be
accessed from both two interfaces, may cause connection failure.

This change is to attach PGT for each PG Portal, set PGT as NULL explicily
for not-allowed portals.

…wed portals.

According to RFC4171,  an entity may have multiple Portals, each Portal
consists of its IP address and port. Besides each PG (portal group)
follows by its own PG IP addresses and TCP/UDP ports.
In order for a Portal to provide access to an iSCSI Node, the PGT
of the PG object MUST be non-NULL.  If the PGT value registered for
a specified Portal and iSCSI Node is NULL, or if no PGT value is registered,
then the Portal does not provide access to that iSCSI Node in the Entity.

So PGT is a selector, that controls from which portal iSCSI Node
is allowed to access. The current implementation attachs a default
PGT with value of 0x00000001 at the end of each iSCSI target,
means each iSCSI target is allowed to access from all portals
ignoring np config in iSCSI target.

For example: a host has two interfaces :
      eth0:192.168.1.10/255.255.255.0
      eth1:10.40.1.20/255.255.255.0
   Also has two iSCSI targets:
      target 1: iqn.1994-11.com.netgear:nas-e7-5b-4c:0e261f2a:group1, np is set as 192.168.1.10:3260.
      target 2: iqn.1994-11.com.netgear:nas-e7-5b-4c:0e261f2a:group1, np is set as 10.40.1.20:3260.

Obviously target 1 is allowed to access from eth0 and target 2 is only from eth1.
While currebt target-isns notifies iSNS server target1 and target 2 can be
accessed from both two interfaces, may cause connection failure.

This change is to attach PGT for each PG Portal, set PGT as NULL explicily
for not-allowed portals.
@cvubrugier
Copy link
Collaborator

Hi @dingjs1421 and thank you for your patch!

I have added some review comments.

I saw that you opened and closed another pull request (#46). I think it is not necessary to create a new pull request when you modify your patch: just git push --force your changes and it should update the existing pull request.

I will be off for a few days so please be patient.

@dingjs1421
Copy link
Author

dingjs1421 commented Aug 15, 2018

Hi @cvubrugier : thank you so much for quick reply. While I didn't see your review comments.

@heroin-moose
Copy link

This patch works for me as intended if a target has a single TPG. If I add more TPGs only the portals from the first TPG are seen on the Windows iSNS server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants