All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 10
@ 2013-10-27  3:11 Hangbin Liu
  2013-10-28 13:06 ` [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 1 Vladislav Yasevich
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Hangbin Liu @ 2013-10-27  3:11 UTC (permalink / raw
  To: linux-sctp

Hi Daniel,

When I run sctp_status test and set max_stream >= 10, the client will
fail with "sendmsg: Invalid argument". Would you like to help have a
look at this?

# ./sctp_status -H 127.0.0.1 -P 9998 -h 127.0.0.1 -p 9999 -s -d 2 -M 20
remote:addr\x127.0.0.1, port=distinct, family=2
local:addr\x127.0.0.1, port=distinct32, family=2

Starting tests...
        socket(SOCK_STREAM, IPPROTO_SCTP)  ->  sk=3
        bind(sk=3, [a:127.0.0.1,p:distinct32])  --  attempt 1/10
        connect(sk=3)
Client: Sending packets.(1/10)
        sendmsg(sk=3, assoc=0) 17768 bytes.
          SNDRCV(stream=1 flags=0x1 ppid„6930886)
        sendmsg(sk=3, assoc=0) 6250 bytes.
          SNDRCV(stream=2 flags=0x1 ppid\x1714636915)
        sendmsg(sk=3, assoc=0) 23634 bytes.
          SNDRCV(stream=3 flags=0x1 ppidB4238335)
        sendmsg(sk=3, assoc=0) 5195 bytes.
          SNDRCV(stream=4 flags=0x1 ppid\x1649760492)
        sendmsg(sk=3, assoc=0) 7978 bytes.
          SNDRCV(stream=5 flags=0x1 ppid\x1189641421)
        sendmsg(sk=3, assoc=0) 22715 bytes.
          SNDRCV(stream=6 flags=0x1 ppid\x1350490027)
        sendmsg(sk=3, assoc=0) 16883 bytes.
          SNDRCV(stream=7 flags=0x1 ppid\x1102520059)
        sendmsg(sk=3, assoc=0) 10724 bytes.
          SNDRCV(stream=8 flags=0x1 ppid\x1967513926)
        sendmsg(sk=3, assoc=0)  125 bytes.
          SNDRCV(stream=9 flags=0x1 ppid\x1540383426)
        sendmsg(sk=3, assoc=0) 2133 bytes.
          SNDRCV(stream\x10 flags=0x1 ppid\x1303455736)

                *** sendmsg: Invalid argument ***

Thanks
Hangbin Liu

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

* Re: [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 1
  2013-10-27  3:11 [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 10 Hangbin Liu
@ 2013-10-28 13:06 ` Vladislav Yasevich
  2013-10-29 18:22 ` Daniel Borkmann
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Vladislav Yasevich @ 2013-10-28 13:06 UTC (permalink / raw
  To: linux-sctp

On Sat, Oct 26, 2013 at 11:11 PM, Hangbin Liu <liuhangbin@gmail.com> wrote:
> Hi Daniel,
>
> When I run sctp_status test and set max_stream >= 10, the client will
> fail with "sendmsg: Invalid argument". Would you like to help have a
> look at this?
>
> # ./sctp_status -H 127.0.0.1 -P 9998 -h 127.0.0.1 -p 9999 -s -d 2 -M 20
> remote:addr\x127.0.0.1, port=distinct, family=2
> local:addr\x127.0.0.1, port=distinct32, family=2
>
> Starting tests...
>         socket(SOCK_STREAM, IPPROTO_SCTP)  ->  sk=3
>         bind(sk=3, [a:127.0.0.1,p:distinct32])  --  attempt 1/10
>         connect(sk=3)
> Client: Sending packets.(1/10)
>         sendmsg(sk=3, assoc=0) 17768 bytes.
>           SNDRCV(stream=1 flags=0x1 ppid„6930886)
>         sendmsg(sk=3, assoc=0) 6250 bytes.
>           SNDRCV(stream=2 flags=0x1 ppid\x1714636915)
>         sendmsg(sk=3, assoc=0) 23634 bytes.
>           SNDRCV(stream=3 flags=0x1 ppidB4238335)
>         sendmsg(sk=3, assoc=0) 5195 bytes.
>           SNDRCV(stream=4 flags=0x1 ppid\x1649760492)
>         sendmsg(sk=3, assoc=0) 7978 bytes.
>           SNDRCV(stream=5 flags=0x1 ppid\x1189641421)
>         sendmsg(sk=3, assoc=0) 22715 bytes.
>           SNDRCV(stream=6 flags=0x1 ppid\x1350490027)
>         sendmsg(sk=3, assoc=0) 16883 bytes.
>           SNDRCV(stream=7 flags=0x1 ppid\x1102520059)
>         sendmsg(sk=3, assoc=0) 10724 bytes.
>           SNDRCV(stream=8 flags=0x1 ppid\x1967513926)
>         sendmsg(sk=3, assoc=0)  125 bytes.
>           SNDRCV(stream=9 flags=0x1 ppid\x1540383426)
>         sendmsg(sk=3, assoc=0) 2133 bytes.
>           SNDRCV(stream\x10 flags=0x1 ppid\x1303455736)
>
>                 *** sendmsg: Invalid argument ***
>

Looks like a possible "off-by-1" bug.  Feel free to fix.

-vlad

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

* Re: [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 1
  2013-10-27  3:11 [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 10 Hangbin Liu
  2013-10-28 13:06 ` [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 1 Vladislav Yasevich
@ 2013-10-29 18:22 ` Daniel Borkmann
  2013-10-30 15:24 ` Daniel Borkmann
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Borkmann @ 2013-10-29 18:22 UTC (permalink / raw
  To: linux-sctp

On 10/27/2013 04:11 AM, Hangbin Liu wrote:
> Hi Daniel,
>
> When I run sctp_status test and set max_stream >= 10, the client will
> fail with "sendmsg: Invalid argument". Would you like to help have a
> look at this?
>
> # ./sctp_status -H 127.0.0.1 -P 9998 -h 127.0.0.1 -p 9999 -s -d 2 -M 20
> remote:addr\x127.0.0.1, port=distinct, family=2
> local:addr\x127.0.0.1, port=distinct32, family=2
>
> Starting tests...
>          socket(SOCK_STREAM, IPPROTO_SCTP)  ->  sk=3
>          bind(sk=3, [a:127.0.0.1,p:distinct32])  --  attempt 1/10
>          connect(sk=3)
> Client: Sending packets.(1/10)
>          sendmsg(sk=3, assoc=0) 17768 bytes.
>            SNDRCV(stream=1 flags=0x1 ppid„6930886)
>          sendmsg(sk=3, assoc=0) 6250 bytes.
>            SNDRCV(stream=2 flags=0x1 ppid\x1714636915)
>          sendmsg(sk=3, assoc=0) 23634 bytes.
>            SNDRCV(stream=3 flags=0x1 ppidB4238335)
>          sendmsg(sk=3, assoc=0) 5195 bytes.
>            SNDRCV(stream=4 flags=0x1 ppid\x1649760492)
>          sendmsg(sk=3, assoc=0) 7978 bytes.
>            SNDRCV(stream=5 flags=0x1 ppid\x1189641421)
>          sendmsg(sk=3, assoc=0) 22715 bytes.
>            SNDRCV(stream=6 flags=0x1 ppid\x1350490027)
>          sendmsg(sk=3, assoc=0) 16883 bytes.
>            SNDRCV(stream=7 flags=0x1 ppid\x1102520059)
>          sendmsg(sk=3, assoc=0) 10724 bytes.
>            SNDRCV(stream=8 flags=0x1 ppid\x1967513926)
>          sendmsg(sk=3, assoc=0)  125 bytes.
>            SNDRCV(stream=9 flags=0x1 ppid\x1540383426)
>          sendmsg(sk=3, assoc=0) 2133 bytes.
>            SNDRCV(stream\x10 flags=0x1 ppid\x1303455736)
>
>                  *** sendmsg: Invalid argument ***

Will have a look tomorrow, thanks.

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

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

* Re: [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 1
  2013-10-27  3:11 [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 10 Hangbin Liu
  2013-10-28 13:06 ` [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 1 Vladislav Yasevich
  2013-10-29 18:22 ` Daniel Borkmann
@ 2013-10-30 15:24 ` Daniel Borkmann
  2013-10-31  2:54 ` Hangbin Liu
  2013-11-04  9:48 ` Daniel Borkmann
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Borkmann @ 2013-10-30 15:24 UTC (permalink / raw
  To: linux-sctp

On 10/27/2013 04:11 AM, Hangbin Liu wrote:
> Hi Daniel,
>
> When I run sctp_status test and set max_stream >= 10, the client will
> fail with "sendmsg: Invalid argument". Would you like to help have a
> look at this?
>
> # ./sctp_status -H 127.0.0.1 -P 9998 -h 127.0.0.1 -p 9999 -s -d 2 -M 20
> remote:addr\x127.0.0.1, port=distinct, family=2
> local:addr\x127.0.0.1, port=distinct32, family=2
>
> Starting tests...
>          socket(SOCK_STREAM, IPPROTO_SCTP)  ->  sk=3
>          bind(sk=3, [a:127.0.0.1,p:distinct32])  --  attempt 1/10
>          connect(sk=3)
> Client: Sending packets.(1/10)
>          sendmsg(sk=3, assoc=0) 17768 bytes.
>            SNDRCV(stream=1 flags=0x1 ppid„6930886)
>          sendmsg(sk=3, assoc=0) 6250 bytes.
>            SNDRCV(stream=2 flags=0x1 ppid\x1714636915)
>          sendmsg(sk=3, assoc=0) 23634 bytes.
>            SNDRCV(stream=3 flags=0x1 ppidB4238335)
>          sendmsg(sk=3, assoc=0) 5195 bytes.
>            SNDRCV(stream=4 flags=0x1 ppid\x1649760492)
>          sendmsg(sk=3, assoc=0) 7978 bytes.
>            SNDRCV(stream=5 flags=0x1 ppid\x1189641421)
>          sendmsg(sk=3, assoc=0) 22715 bytes.
>            SNDRCV(stream=6 flags=0x1 ppid\x1350490027)
>          sendmsg(sk=3, assoc=0) 16883 bytes.
>            SNDRCV(stream=7 flags=0x1 ppid\x1102520059)
>          sendmsg(sk=3, assoc=0) 10724 bytes.
>            SNDRCV(stream=8 flags=0x1 ppid\x1967513926)
>          sendmsg(sk=3, assoc=0)  125 bytes.
>            SNDRCV(stream=9 flags=0x1 ppid\x1540383426)
>          sendmsg(sk=3, assoc=0) 2133 bytes.
>            SNDRCV(stream\x10 flags=0x1 ppid\x1303455736)
>
>                  *** sendmsg: Invalid argument ***

Hangbin, the below fix should do it (it worked for you up to that point as
that is the default number of streams) ... will push that _at latest_ on
Sunday night as I'll be mostly on travel the next days.

Well, looking at the code, at some point in time these tools need a fresh
start in general; those were probably just quickly clobbered together from
the very early days of lksctp. :)

diff --git a/src/apps/sctp_status.c b/src/apps/sctp_status.c
index 3a05dc4..5bb48ef 100644
--- a/src/apps/sctp_status.c
+++ b/src/apps/sctp_status.c
@@ -675,11 +675,11 @@ int next_stream(int state, int pattern)
  {
  	switch (pattern){
  	case STREAM_PATTERN_RANDOM:
-		state = rand() % (max_stream + 1);
+		state = rand() % max_stream;
  		break;
  	case STREAM_PATTERN_SEQUENTIAL:
  		state = state + 1;
-		if (state > max_stream)
+		if (state >= max_stream)
  			state = 0;
  		break;
  	}
@@ -723,7 +723,7 @@ void client(int sk) {
  } /* client() */

  void start_test(int role) {
-	int sk, pid;
+	int sk, pid, ret;
  	int i = 0;

  	DEBUG_PRINT(DEBUG_NONE, "\nStarting tests...\n");
@@ -745,6 +745,22 @@ void start_test(int role) {
  		listen_r(sk, 1);
  		accept_r(sk);
  	} else {
+		if (max_stream > 0) {
+			struct sctp_initmsg initmsg;
+
+			memset(&initmsg, 0, sizeof(initmsg));
+			initmsg.sinit_num_ostreams = max_stream;
+			initmsg.sinit_max_instreams = max_stream;
+			initmsg.sinit_max_attempts = 3;
+
+			ret = setsockopt(sk, IPPROTO_SCTP, SCTP_INITMSG,
+					 &initmsg, sizeof(initmsg));
+			if (ret < 0) {
+				perror("setsockopt(SCTP_INITMSG)");
+				exit(0);
+			}
+		}
+
  		connect_r(sk, (struct sockaddr *)&s_rem, r_len);
  	}


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

* Re: [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 1
  2013-10-27  3:11 [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 10 Hangbin Liu
                   ` (2 preceding siblings ...)
  2013-10-30 15:24 ` Daniel Borkmann
@ 2013-10-31  2:54 ` Hangbin Liu
  2013-11-04  9:48 ` Daniel Borkmann
  4 siblings, 0 replies; 6+ messages in thread
From: Hangbin Liu @ 2013-10-31  2:54 UTC (permalink / raw
  To: linux-sctp

On Wed, Oct 30, 2013 at 04:24:08PM +0100, Daniel Borkmann wrote:
> On 10/27/2013 04:11 AM, Hangbin Liu wrote:
> >Hi Daniel,
> >
> >When I run sctp_status test and set max_stream >= 10, the client will
> >fail with "sendmsg: Invalid argument". Would you like to help have a
> >look at this?
> >
> ># ./sctp_status -H 127.0.0.1 -P 9998 -h 127.0.0.1 -p 9999 -s -d 2 -M 20
> >remote:addr\x127.0.0.1, port=distinct, family=2
> >local:addr\x127.0.0.1, port=distinct32, family=2
> >
> >Starting tests...
> >         socket(SOCK_STREAM, IPPROTO_SCTP)  ->  sk=3
> >         bind(sk=3, [a:127.0.0.1,p:distinct32])  --  attempt 1/10
> >         connect(sk=3)
> >Client: Sending packets.(1/10)
> >         sendmsg(sk=3, assoc=0) 17768 bytes.
> >           SNDRCV(stream=1 flags=0x1 ppid„6930886)
> >         sendmsg(sk=3, assoc=0) 6250 bytes.
> >           SNDRCV(stream=2 flags=0x1 ppid\x1714636915)
> >         sendmsg(sk=3, assoc=0) 23634 bytes.
> >           SNDRCV(stream=3 flags=0x1 ppidB4238335)
> >         sendmsg(sk=3, assoc=0) 5195 bytes.
> >           SNDRCV(stream=4 flags=0x1 ppid\x1649760492)
> >         sendmsg(sk=3, assoc=0) 7978 bytes.
> >           SNDRCV(stream=5 flags=0x1 ppid\x1189641421)
> >         sendmsg(sk=3, assoc=0) 22715 bytes.
> >           SNDRCV(stream=6 flags=0x1 ppid\x1350490027)
> >         sendmsg(sk=3, assoc=0) 16883 bytes.
> >           SNDRCV(stream=7 flags=0x1 ppid\x1102520059)
> >         sendmsg(sk=3, assoc=0) 10724 bytes.
> >           SNDRCV(stream=8 flags=0x1 ppid\x1967513926)
> >         sendmsg(sk=3, assoc=0)  125 bytes.
> >           SNDRCV(stream=9 flags=0x1 ppid\x1540383426)
> >         sendmsg(sk=3, assoc=0) 2133 bytes.
> >           SNDRCV(stream\x10 flags=0x1 ppid\x1303455736)
> >
> >                 *** sendmsg: Invalid argument ***
> 
> Hangbin, the below fix should do it (it worked for you up to that point as
> that is the default number of streams) ... will push that _at latest_ on

Ah, I see, thanks for this patch

> Sunday night as I'll be mostly on travel the next days.
> 
> Well, looking at the code, at some point in time these tools need a fresh
> start in general; those were probably just quickly clobbered together from
> the very early days of lksctp. :)

Yes, It looks like this tool was written for SCTP conformance testing

> 
> diff --git a/src/apps/sctp_status.c b/src/apps/sctp_status.c
> index 3a05dc4..5bb48ef 100644
> --- a/src/apps/sctp_status.c
> +++ b/src/apps/sctp_status.c
> @@ -675,11 +675,11 @@ int next_stream(int state, int pattern)
>  {
>  	switch (pattern){
>  	case STREAM_PATTERN_RANDOM:
> -		state = rand() % (max_stream + 1);
> +		state = rand() % max_stream;
>  		break;
>  	case STREAM_PATTERN_SEQUENTIAL:
>  		state = state + 1;
> -		if (state > max_stream)
> +		if (state >= max_stream)
>  			state = 0;
>  		break;
>  	}
> @@ -723,7 +723,7 @@ void client(int sk) {
>  } /* client() */
> 
>  void start_test(int role) {
> -	int sk, pid;
> +	int sk, pid, ret;
>  	int i = 0;
> 
>  	DEBUG_PRINT(DEBUG_NONE, "\nStarting tests...\n");
> @@ -745,6 +745,22 @@ void start_test(int role) {
>  		listen_r(sk, 1);
>  		accept_r(sk);
>  	} else {
> +		if (max_stream > 0) {
> +			struct sctp_initmsg initmsg;
> +
> +			memset(&initmsg, 0, sizeof(initmsg));
> +			initmsg.sinit_num_ostreams = max_stream;
> +			initmsg.sinit_max_instreams = max_stream;
> +			initmsg.sinit_max_attempts = 3;
> +
> +			ret = setsockopt(sk, IPPROTO_SCTP, SCTP_INITMSG,
> +					 &initmsg, sizeof(initmsg));
> +			if (ret < 0) {
> +				perror("setsockopt(SCTP_INITMSG)");
> +				exit(0);
> +			}
> +		}
> +
>  		connect_r(sk, (struct sockaddr *)&s_rem, r_len);
>  	}
> 

-- 

Thanks & Best Regards
Hangbin Liu <liuhangbin@gmail.com>

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

* Re: [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 1
  2013-10-27  3:11 [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 10 Hangbin Liu
                   ` (3 preceding siblings ...)
  2013-10-31  2:54 ` Hangbin Liu
@ 2013-11-04  9:48 ` Daniel Borkmann
  4 siblings, 0 replies; 6+ messages in thread
From: Daniel Borkmann @ 2013-11-04  9:48 UTC (permalink / raw
  To: linux-sctp

On 10/31/2013 03:54 AM, Hangbin Liu wrote:
> On Wed, Oct 30, 2013 at 04:24:08PM +0100, Daniel Borkmann wrote:
>> On 10/27/2013 04:11 AM, Hangbin Liu wrote:
>>> Hi Daniel,
>>>
>>> When I run sctp_status test and set max_stream >= 10, the client will
>>> fail with "sendmsg: Invalid argument". Would you like to help have a
>>> look at this?
>>>
>>> # ./sctp_status -H 127.0.0.1 -P 9998 -h 127.0.0.1 -p 9999 -s -d 2 -M 20
>>> remote:addr\x127.0.0.1, port=distinct, family=2
>>> local:addr\x127.0.0.1, port=distinct32, family=2
>>>
>>> Starting tests...
>>>          socket(SOCK_STREAM, IPPROTO_SCTP)  ->  sk=3
>>>          bind(sk=3, [a:127.0.0.1,p:distinct32])  --  attempt 1/10
>>>          connect(sk=3)
>>> Client: Sending packets.(1/10)
>>>          sendmsg(sk=3, assoc=0) 17768 bytes.
>>>            SNDRCV(stream=1 flags=0x1 ppid„6930886)
>>>          sendmsg(sk=3, assoc=0) 6250 bytes.
>>>            SNDRCV(stream=2 flags=0x1 ppid\x1714636915)
>>>          sendmsg(sk=3, assoc=0) 23634 bytes.
>>>            SNDRCV(stream=3 flags=0x1 ppidB4238335)
>>>          sendmsg(sk=3, assoc=0) 5195 bytes.
>>>            SNDRCV(stream=4 flags=0x1 ppid\x1649760492)
>>>          sendmsg(sk=3, assoc=0) 7978 bytes.
>>>            SNDRCV(stream=5 flags=0x1 ppid\x1189641421)
>>>          sendmsg(sk=3, assoc=0) 22715 bytes.
>>>            SNDRCV(stream=6 flags=0x1 ppid\x1350490027)
>>>          sendmsg(sk=3, assoc=0) 16883 bytes.
>>>            SNDRCV(stream=7 flags=0x1 ppid\x1102520059)
>>>          sendmsg(sk=3, assoc=0) 10724 bytes.
>>>            SNDRCV(stream=8 flags=0x1 ppid\x1967513926)
>>>          sendmsg(sk=3, assoc=0)  125 bytes.
>>>            SNDRCV(stream=9 flags=0x1 ppid\x1540383426)
>>>          sendmsg(sk=3, assoc=0) 2133 bytes.
>>>            SNDRCV(stream\x10 flags=0x1 ppid\x1303455736)
>>>
>>>                  *** sendmsg: Invalid argument ***
>>
>> Hangbin, the below fix should do it (it worked for you up to that point as
>> that is the default number of streams) ... will push that _at latest_ on
>
> Ah, I see, thanks for this patch
>
>> Sunday night as I'll be mostly on travel the next days.
>>
>> Well, looking at the code, at some point in time these tools need a fresh
>> start in general; those were probably just quickly clobbered together from
>> the very early days of lksctp. :)
>
> Yes, It looks like this tool was written for SCTP conformance testing
>
>>
>> diff --git a/src/apps/sctp_status.c b/src/apps/sctp_status.c
>> index 3a05dc4..5bb48ef 100644
>> --- a/src/apps/sctp_status.c
>> +++ b/src/apps/sctp_status.c
>> @@ -675,11 +675,11 @@ int next_stream(int state, int pattern)
>>   {
>>   	switch (pattern){
>>   	case STREAM_PATTERN_RANDOM:
>> -		state = rand() % (max_stream + 1);
>> +		state = rand() % max_stream;
>>   		break;
>>   	case STREAM_PATTERN_SEQUENTIAL:
>>   		state = state + 1;
>> -		if (state > max_stream)
>> +		if (state >= max_stream)
>>   			state = 0;
>>   		break;
>>   	}
>> @@ -723,7 +723,7 @@ void client(int sk) {
>>   } /* client() */
>>
>>   void start_test(int role) {
>> -	int sk, pid;
>> +	int sk, pid, ret;
>>   	int i = 0;
>>
>>   	DEBUG_PRINT(DEBUG_NONE, "\nStarting tests...\n");
>> @@ -745,6 +745,22 @@ void start_test(int role) {
>>   		listen_r(sk, 1);
>>   		accept_r(sk);
>>   	} else {
>> +		if (max_stream > 0) {
>> +			struct sctp_initmsg initmsg;
>> +
>> +			memset(&initmsg, 0, sizeof(initmsg));
>> +			initmsg.sinit_num_ostreams = max_stream;
>> +			initmsg.sinit_max_instreams = max_stream;
>> +			initmsg.sinit_max_attempts = 3;
>> +
>> +			ret = setsockopt(sk, IPPROTO_SCTP, SCTP_INITMSG,
>> +					 &initmsg, sizeof(initmsg));
>> +			if (ret < 0) {
>> +				perror("setsockopt(SCTP_INITMSG)");
>> +				exit(0);
>> +			}
>> +		}
>> +
>>   		connect_r(sk, (struct sockaddr *)&s_rem, r_len);
>>   	}

Ok, applied.

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

end of thread, other threads:[~2013-11-04  9:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-27  3:11 [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 10 Hangbin Liu
2013-10-28 13:06 ` [lksctp-developers] sctp_status: Got sendmsg: Invalid argument when set max_stream larger than 1 Vladislav Yasevich
2013-10-29 18:22 ` Daniel Borkmann
2013-10-30 15:24 ` Daniel Borkmann
2013-10-31  2:54 ` Hangbin Liu
2013-11-04  9:48 ` Daniel Borkmann

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.