Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sagi@grimberg.me (Sagi Grimberg)
Subject: [PATCH v2 0/3] Commonise address any check
Date: Wed,  7 Feb 2018 15:05:15 +0200	[thread overview]
Message-ID: <20180207130518.22803-1-sagi@grimberg.me> (raw)

Both iscsit and nvmet need to check the listening endpoint
portal is not INADDR_ANY (or IN6ADDR_ANY_INIT) when replying
to a discovery information query (iscsi sendtaragets or nvmet
discovery log pages). If indeed the nvmet port or iscsit portal
are listening on any address, they need to return the source
address of the socket that carried the query itslef.

iscsit already does this while nvmet did not.
instead of copying the inaddr_any check, place it in net-utils
and call it from both (patches 1+3).

In addition, fix the behavior in nvmet (patch 2).

Changes from v1:
- small alignment fix in inet_addr_is_any
- warn if got unexpected address family
- make in6_any static

Sagi Grimberg (3):
  net/utils: Introduce inet_addr_is_any
  nvmet: don't return "any" ip address in discovery log page
  iscsi-target: use common inet_addr_is_any

 drivers/nvme/target/discovery.c     | 30 +++++++++++++++++++++++++++---
 drivers/nvme/target/nvmet.h         |  2 ++
 drivers/nvme/target/rdma.c          | 18 ++++++++++++++++++
 drivers/target/iscsi/iscsi_target.c | 28 ++--------------------------
 include/linux/inet.h                |  1 +
 net/core/utils.c                    | 23 +++++++++++++++++++++++
 6 files changed, 73 insertions(+), 29 deletions(-)

-- 
2.14.1

             reply	other threads:[~2018-02-07 13:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-07 13:05 Sagi Grimberg [this message]
2018-02-07 13:05 ` [PATCH v2 1/3] net/utils: Introduce inet_addr_is_any Sagi Grimberg
2018-02-07 19:24   ` Bart Van Assche
2018-02-07 13:05 ` [PATCH v2 2/3] nvmet: don't return "any" ip address in discovery log page Sagi Grimberg
2018-02-07 13:05 ` [PATCH v2 3/3] iscsi-target: use common inet_addr_is_any Sagi Grimberg
2018-02-07 19:26   ` Bart Van Assche
2018-02-08  8:12   ` Johannes Thumshirn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180207130518.22803-1-sagi@grimberg.me \
    --to=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox