linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xin Long <lucien.xin@gmail.com>
To: linux-sctp@vger.kernel.org
Subject: Re: SCTP nailed down connections trouble
Date: Thu, 17 May 2018 07:43:20 +0000	[thread overview]
Message-ID: <CADvbK_d11bnCV2vOVJGRHGasgj5JvRzosoMKt0JhEYW160JuMA@mail.gmail.com> (raw)
In-Reply-To: <F7A4BA05-180B-4762-A4CD-3348DC41364F@list.fink.org>

On Thu, May 17, 2018 at 1:17 AM, Andreas Fink <afink@list.fink.org> wrote:
>
>> ...
>>> A second area where I found issues is on how to configure a specific
>>> port to be used for multiple connections. For example my local port
>>> 2000 can be used for a connection to host 1 or to host 2 and the
>>> individual sessions which are created as above will however not
>>> allow me to use the same port in a second socket even though the
>>> bind is not follwed with a listen and the sctp_connectx goes to  a
>>> different port. Workaround to this is to use different ports for
>>> every connection (which is not really nice). Maybe there's another
>>> way?
>>
>> Needs to check on this.
>
> Could that be related to the missing SCTP_REUSE_PORT socket option?
>
That's right, but SO_REUSEADDR works as the equivalent of
SCTP_REUSE_PORT for SCTP in linux, and for now you can work around by:

        if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)) = -1) {
                perror("reuse port failed");
                exit(-1);
        }

I'll add SCTP_REUSE_PORT sockopt in linux SCTP soon. Thanks.

  parent reply	other threads:[~2018-05-17  7:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16 12:02 SCTP nailed down connections trouble Andreas Fink
2018-05-16 16:29 ` Marcelo Ricardo Leitner
2018-05-16 17:17 ` Andreas Fink
2018-05-16 17:25 ` Marcelo Ricardo Leitner
2018-05-17  7:43 ` Xin Long [this message]
2018-05-17 16:58 ` David Laight
2018-05-17 19:14 ` Andreas Fink

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=CADvbK_d11bnCV2vOVJGRHGasgj5JvRzosoMKt0JhEYW160JuMA@mail.gmail.com \
    --to=lucien.xin@gmail.com \
    --cc=linux-sctp@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).