nvmet: don't return "any" ip address in discovery log page
authorSagi Grimberg <sagi@grimberg.me>
Wed, 24 Jan 2018 18:27:10 +0000 (20:27 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 26 Mar 2018 14:53:43 +0000 (08:53 -0600)
commit4c65268588102014837b2d09e5a02557e5d3fc9e
tree2778e3f03905f2b14faf5bf3df397c6be7719936
parenta470143fc83924251647143ff042bd2843e296cf
nvmet: don't return "any" ip address in discovery log page

Its perfectly valid to assign a nvmet port to listen on "any"
IP address (traddr 0.0.0.0 for ipv4 address family) for IP based
transport ports. However, we must not return this address in
discovery log entries. Instead we need to return the address
where the request was accepted on (req->port address).

Since this is nvme transport specific, introduce an optional
.disc_traddr interface that is designed to check that a
port in question is bound to "any" IP address and if so, set
the traddr from the port where the request came from.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/target/discovery.c
drivers/nvme/target/nvmet.h
drivers/nvme/target/rdma.c