[英]How to remove the authorization set by TCP_MD5SIG in setsockopt - C, Linux?
I have used TCP_MD5SIG to create password/key for the connection using the API - setsockopt() in C, Linux. 我已经使用TCP_MD5SIG使用API-C,Linux中的setsockopt()为连接创建密码/密钥。 This works fine for me.
这对我来说很好。 However, when I use it to remove the password/disable authorization with the same API except that the
但是,当我使用它通过相同的API删除密码/禁用授权时,除了
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.
当我通过密码时,相同的API起作用。 On the other hand, the same API doesn't work when I want to disable the authorization.
另一方面,当我想禁用授权时,相同的API无法正常工作。 I have enabled this protocol in the kernel.
我已经在内核中启用了该协议。 So, there is no issue with enabling of this feature in kernel.
因此,在内核中启用此功能没有问题。
AFAICT,您需要确保tcp_md5sig.tcpm_addr
与注册时相同,以将其删除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.