I have used TCP_MD5SIG to create password/key for the connection using the API - setsockopt() in C, Linux. This works fine for me. However, when I use it to remove the password/disable authorization with the same API except that the
struct_tcp_md5sig.tcm_Key = 0;
struc tcp_md5sig.tcm_keylen = 0;
I see that when I invoke the same API -
rc = setsockopt(sock_fd, IPPROTO_TCP, TCP_MD5SIG, &md5sig, sizeof(md5sig));
I see that the rc is -1. The strerror says that "no such file or directory".
I am confused on what I should do to disable the authorization. The same API works, when I pass the password. On the other hand, the same API doesn't work when I want to disable the authorization. I have enabled this protocol in the kernel. So, there is no issue with enabling of this feature in kernel.