这两个标志经常一起设置。它们有什么区别?
最佳答案
IFF_UP This flag is read-only for the driver. The kernel turns it on when the interface is active and ready to transfer packets.
...
IFF_RUNNING
This flag indicates that the interface is up and running. It is mostly present for BSD compatibility; the kernel makes little use of it. Most network drivers need not worry about IFF_RUNNING.
再深入一点,似乎有一个显着差异:
IFF_RUNNING
应该反射(reflect)网络接口(interface)上的操作状态,而不是其管理状态。举个例子,一个以太网接口(interface)可能被管理员UP
(例如ifconfig eth0 up
),但它不会被认为是可操作的(即RUNNING
根据 RFC2863)如果电缆未插入。
关于c - IFF_UP 和 IFF_RUNNING 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11679514/