kri*_*itx 2 linux linux-kernel
我可以理解 的输出strace route -n
,但route
真的读取任何文件/proc
来获取路由表吗?此外,如果路由和 IP 地址存储在 下/proc
,为什么不strace
显示正在访问的文件?
root@xxxx:/etc/postfix# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.21.58.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
0.0.0.0 10.21.58.1 0.0.0.0 UG 100 0 0 eth0
Run Code Online (Sandbox Code Playgroud)
编辑,经过更多研究:
似乎route
确实读取了/proc
:下的文件,特别是/proc/net/route
. 那么,路由信息是如何到达那里的呢?