]> git.baikalelectronics.ru Git - kernel.git/commit
iscsi-target: Fix discovery with INADDR_ANY and IN6ADDR_ANY_INIT
authorNicholas Bellinger <nab@linux-iscsi.org>
Tue, 17 Jan 2012 07:33:48 +0000 (23:33 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 18 Jan 2012 08:35:58 +0000 (08:35 +0000)
commitc5a98b96f69981a8fe87d61b21f7ef04c63c4382
tree2891680fbe0b57299776d44123969452a9cb1a25
parent5fc03026f889f3fb66585c7718869f02ec5cd262
iscsi-target: Fix discovery with INADDR_ANY and IN6ADDR_ANY_INIT

This patch addresses a bug with sendtargets discovery where INADDR_ANY (0.0.0.0)
+ IN6ADDR_ANY_INIT ([0:0:0:0:0:0:0:0]) network portals where incorrectly being
reported back to initiators instead of the address of the connecting interface.
To address this, save local socket ->getname() output during iscsi login setup,
and makes iscsit_build_sendtargets_response() return these TargetAddress keys
when INADDR_ANY or IN6ADDR_ANY_INIT portals are in use.

Reported-by: Dax Kelson <dkelson@gurulabs.com>
Reported-by: Andy Grover <agrover@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target.c
drivers/target/iscsi/iscsi_target_core.h
drivers/target/iscsi/iscsi_target_login.c