Skip to content

getsockopt() fails with option: SCTP_HMAC_IDENT #69

@marcellgg

Description

@marcellgg

Even if you are root, getsockopt() fails with option SCTP_HMAC_IDENT : Permission denied. Following code shows this:

#include <stdio.h>
#include <unistd.h>
#include <netinet/sctp.h>

int
main(void)
{
int sock;
char optval[1024];
socklen_t optlen = sizeof(optval);

if (geteuid() != 0) {  /* to be sure we're root */
fprintf(stderr, "You are not root\n");
return 1;
}
sock = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP);
if (getsockopt(sock, IPPROTO_SCTP, SCTP_HMAC_IDENT, optval, &optlen) < 0) {
perror("getsockopt()");
return 1;
}
return 0;

}

Execution of program above, as root, outputs:

getsockopt(): Permission denied

My version of lksctp-tools: 1.0.19+dfsg-2

Regards,
Yves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions