[英]Path MTU Discovery using Socket option - IP_MTU & IP_MTU_DISCOVER
[英]Missing IP_MTU socket option define on Debian Etch?
我正在尝试使用IP_MTU
套接字选项读取TCP连接的MTU
根据在我的Debian Etch上安装的man 7 ip
(我知道它已经很旧了,但是现在不能更改):
SYNOPSIS
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h> /* superset of previous */
[CUT]
IP_MTU Retrieve the current known path MTU of the current socket.
Only valid when the socket has been connected. Returns an integer.
Only valid as a getsockopt(2).
问题是上面的套接字选项在手册页命名的任何包含文件中都不存在。 (因此我的代码未编译;)
相反,我在<linux/in.h>
找到了它( grep
是您的朋友)
如果我尝试将<linux/in.h>
添加到我的源代码中, <linux/in.h>
各种多重定义/重新声明编译错误。 有谁知道为什么标头中缺少上述参数以及如何解决该问题?
非常感谢
塞尔吉奥
答案是:我认为没有答案。 我正在运行Red Hat Enterprise Linux AS版本4(Nahant Update 8),并且遇到了完全相同的问题:
因此,我想唯一要做的就是通过设置MTU发现,不断调整MTU并观察内核在尝试发送太大消息时关闭您的方法来解决。 那就是我要做的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.