![](/img/trans.png)
[英]how I will use setsockopt and getsockopt with KEEP_ALIVE in linux c programming to determine broken tcp/ip connection?
[英]How to remove the authorization set by TCP_MD5SIG in setsockopt - C, Linux?
我已經使用TCP_MD5SIG使用API-C,Linux中的setsockopt()為連接創建密碼/密鑰。 這對我來說很好。 但是,當我使用它通過相同的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".
我對禁用授權應該怎么做感到困惑。 當我通過密碼時,相同的API起作用。 另一方面,當我想禁用授權時,相同的API無法正常工作。 我已經在內核中啟用了該協議。 因此,在內核中啟用此功能沒有問題。
AFAICT,您需要確保tcp_md5sig.tcpm_addr
與注冊時相同,以將其刪除。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.