All of lore.kernel.org
 help / color / mirror / Atom feed
* IP_FREEBIND and binding to in-use addr:ports
@ 2013-02-07  0:47 Andy Grover
  2013-02-07 18:42 ` Andy Grover
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Grover @ 2013-02-07  0:47 UTC (permalink / raw)
  To: target-devel; +Cc: netdev

OK, this is weird:

https://bugzilla.redhat.com/show_bug.cgi?id=908368

It appears you can listen on the same address:port if you do it from a 
different iscsi target, or even a different tpg (so there are no 
configfs name collisions). I believe this is because we are setting 
IP_FREEBIND sockopt, so we can configure listening on iscsi portals (aka 
ip:port) before the IP is assigned.

from ip(7):
IP_FREEBIND (since Linux 2.4)
If enabled, this boolean option allows binding to an IP address that is
nonlocal or does not (yet) exist.  This permits listening on a socket,
without requiring the underlying network interface or the specified
dynamic IP address to be up at the time that the application is trying
to bind to it.  This option is the per-socket equivalent of the
ip_nonlocal_bind /proc interface described below.

This doesn't say anything about if the address:port is already in use. 
Dave/netdev, should the network stack be returning an error when 
attempting to bind to an address:port already in use even if IP_FREEBIND 
is set, or should the caller be checking for this before trying to 
kernel_bind()?

Or is something else the issue?

Thanks -- Regards -- Andy

p.s. see drivers/target/iscsi/iscsi_target_login.c line ~846 for caller 
code.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-02-19  4:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-07  0:47 IP_FREEBIND and binding to in-use addr:ports Andy Grover
2013-02-07 18:42 ` Andy Grover
2013-02-08 23:05   ` [PATCH] Don't allow multiple TPGs or targets to share a portal Andy Grover
2013-02-13 20:31     ` Nicholas A. Bellinger
2013-02-13 22:09       ` Andy Grover
2013-02-15 15:46         ` Nicholas A. Bellinger
2013-02-18 22:41           ` Andy Grover
2013-02-19  4:34             ` Nicholas A. Bellinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.