Reputation: 211
During establishment of one-to-one sctp connection, below error is reported in internal server logs after accept() of sctp connection:
"Error getting socket options for socket: 13"
From the error, it seems that getsockopt() has returned an error, and according to function description in "getsockopt(2) - Linux man page" errno is set to indicate the reason.
I need your help to know how to check errno and track the reason of this failure.
FYI, from tcpdump I have below flow of messages, the connection is shutdown by server.
No. Time Source Destination Protocol Message
19716 16:47:25.174569 client server SCTP INIT
19717 16:47:25.174667 server client SCTP INIT_ACK
19718 16:47:25.174905 client server SCTP COOKIE_ECHO
19719 16:47:25.174962 server client SCTP COOKIE_ACK
19720 16:47:25.175175 server client SCTP SHUTDOWN
19721 16:47:25.175507 client server SCTP SHUTDOWN_ACK
19722 16:47:25.175537 server client SCTP SHUTDOWN_COMPLETE
Appreciate your support, Thanks in advance
Upvotes: 1
Views: 1558
Reputation: 7852
The server generates the cookie and sends to the client via INIT chunk. The client responds back a with cookie echo which shall have a signature for authentication & valid lifetime via INIT ACK chunk. This cookie received via INIT ACK chunk shall be validated by the server as a kind of authentication mechanism. If the server is not able to successfully validate the cookie and use it to build the TCB, then it shall not go ahead with the establishment and usage of the association.
Note that perror is just a function that will give you the standard error message for a given error code. That is, if you make a call to write() and if there is an error, you could invoke perror immediately after write() to know about the actual error. It is declared in stdio.h.
Incase of difficulty in using perror, you can try an equivalent to perror : fprintf(stderr, "%s\n", strerror(errno));
Upvotes: 1
Reputation: 6887
Is it your code? You should use strerror_r
to get a message from the error number. Otherwise you can install the perror
binary to print numeric errors.
13 seems to be EACCES
, which isn't documented in the man page (an all to common problem on Linux). A quick kernel search seems to indicate the most common reason is sctp authentication/encryption is not enabled, but that's in no way conclusive.
Upvotes: 1