【发布时间】:2016-06-22 21:18:14
【问题描述】:
谁能解释 SO_DEBUG 和 SO_DONTROUTE 之间的区别。这是我的理解
SO_DONTROUTE
Enable / disable routing bypass for outgoing message
Routing takes place only when it goes to out of subnet.
This tell that do not route, directly connect to the destination instead of routing
SO_DONTROUTE refers to the local routing
But default it is zero
Do not route send directly to the connected network
If the host is not on a directly-attached network
an error is returned. This option can be used to ping
a local host through an interface that has no route.
SO_DEBUG
When enabled, the kernel keeps track of detailed
information about the packets sent and received by TCP for the socket
但是在 traceroute 中,如果我在命令行中给出 -d 选项,那么 SO_DONTROUTE 选项也会被启用。此外,当我启用 -r 选项时,-d 也启用了 .我可以知道为什么吗?
【问题讨论】:
-
你用的是什么版本的traceroute?
-
van jacobson 编写的第一版 traceroute
-
你是如何确定
-d开启了SO_DONTROUTE? -
我已经使用 strace 命令检查了哪些选项都已启用
-
这很奇怪。我看不出这两个标志之间有任何合理的关系,并且 van jacobson 的 traceroute 的来源是有意义的 -
-r导致SO_DONTROUTE被设置为-d设置为SO_DEBUG。也许来源来自不同的版本。无论如何,这听起来像是一个错误,而不是一个功能。我的 Ubuntu 14.04 服务器上的(默认)traceroute 没有这样做。
标签: sockets network-programming traceroute