These two flags are often set together. What is the difference between them?
The net device structure, defined in file linux/include/netdevice. h, is the data structure that defines an instance of a network interface. It tracks the state information of all the network interface devices attached to the TCP/IP stack.
SIOCGIFADDR. Get the interface address for the given interface. argp shall point to a ifreq structure. Before calling, the caller should fill in the ifr_name field with the interface name, and upon return, the ifr_ifru. ifru_addr field is set with the interface address.
From Linux Device Drivers 3:
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.
Digging a bit deeper, it seems that there is one significant difference:
IFF_RUNNING
is supposed to reflect the operational status on a network interface, rather than its administrative one. To provide an example, an Ethernet interface may be brought UP
by the administrator (e.g. ifconfig eth0 up
), but it will not be considered operational (i.e. RUNNING
as per RFC2863) if the cable is not plugged in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With