0

I am trying to set SCTP_MAX_BURST using the following code

struct sctp_assoc_value assocValue;
memset(&assocValue, 0, sizeof(assocValue));
assocValue.assoc_value = getMaxBurstValue();
setsockopt (fd, IPPROTO_SCTP, SCTP_MAX_BURST, &assocValue, sizeof (assocValue));

When I execute the code I get the following error: "No such file or directory"

Could anyone help me with the possible reason for the failure?

Bwooce
  • 2,123
  • 19
  • 28
jhon
  • 87
  • 2
  • 10

1 Answers1

0

The text you mention ("No such file..") is for ENOENT, 2, which isn't listed as a return for setsockopt on any of the Linux systems I have access to.

On my Redhat 5 system, I get back ENOPROTOOPT (errno 92) because the kernel hasn't implemented that socket option for 2.6.18's sctp.

Rick Berge
  • 474
  • 1
  • 4
  • 14
  • When i changed the IPPROTO_SCTP to SOL_SOCKET, I am not getting any error and I am bale to set the value and getsockopt is also showing whatever value I have set, But I m not sure is it a right way setsockopt (fd, SOL_SOKCET, SCTP_MAX_BURST, &assocValue, sizeof (assocValue)); – jhon May 04 '12 at 02:59
  • @jhon, According to RFC 6458, the socket does have to be many-to-one flavor: int sock = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP); and it is an SCTP-level option int rc = setsockopt(sock, IPPROTO_SCTP, SCTP_MAX_BURST, &assocValue, sizeof(assocValue)); By picking a different level, you are getting a SOL_SOCKET level option that just happens to have the same integer value as the SCTP-level enum. – Rick Berge May 07 '12 at 14:13
  • -where exactly in RFC 6458 its mentioned that it has to be many to one flavor to set MAX_BURST? i was trying to find out but couldn't get that? – jhon Jun 18 '12 at 16:33
  • Now I don't know why I wrote that. Maybe I was looking elsewhere or assumed from the title that you meant "for a specific association." Perhaps I had a head wound. Section 8, par. ~2-4 talks about the scope differences between 1-1 and 1-N, and doesn't mention that limit. – Rick Berge Jun 19 '12 at 18:25