RE: Multiple connections from the same source address.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: 'Marcelo Ricardo Leitner'
> Sent: 08 September 2017 16:11
> On Fri, Sep 08, 2017 at 03:01:22PM +0000, David Laight wrote:
> > From: Marcelo Ricardo Leitner
> > > Sent: 08 September 2017 15:50
> > > On Fri, Sep 08, 2017 at 09:03:31AM +0000, David Laight wrote:
> > > > Can anyone think how to create multiple outgoing connections
> > > > from the same subset of local IP addresses and the same port?
> > > >
> > > > We bind() to the first IP address and port, then use
> > > > SCTP_SOCKOPT_BINDX_ADD to add the second IP address.
> > > > But even with IP_REUASADDR set you can't repeat that on
> > > > a second socket.
> > >
> > > When did you set IP_REUSEADDR? Checking the code, seems you have to set
> > > it before any binding, because then the port entry will be created and
> > > such flag will be initialized with that state.
> >
> > Indeed, otherwise it has no effect.
> >
> 
> For both sockets, right? I'll debug this if yes.
> 
> > The point is that (IIRC) IP_REUSEADDR only lets you bind the same
> > port number to 2 sockets - the IP addresses have to be different.
> 
> I'm not seeing where this could be happening. I see this:
>                 if (pp->fastreuse && sk->sk_reuse &&
>                         sk->sk_state != SCTP_SS_LISTENING)
>                         goto success;
> Meaning that if the port allows reusing and so does the new socket, and
> it's not in listening state, it would be allowed.

I wonder if the behaviour has changed since I last tested it.
(Nothing obvious since 2008)

	David


--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux