[Olsr-dev] [PATCH v1 0/9] Also consider link state
Thu Feb 11 13:47:09 CET 2016
On 11/02/16 13:27, Bastian Bittorf wrote:
> * Henning Rogge <(spam-protected)> [11.02.2016 13:19]:
>>> needed. maybe it is enough to ask e.g. '/sys/class/net/eth0.2/operstate'?
>>> is it polled or does ethtool.h gives you an event?
>> The ethtool thing is my fault... I could not remember why we removed
>> the IFF_RUNNING detection... so I suggested trying something
>> But if the ethtool output is broken TOO (on the routers), it will not help.
> ethtool output will NOT work on switches, but
> /sys/class/net/eth0.2/operstate will. it means if 1 port goes up
> all ports are 'on'. so the worst case is, that it cannot be detected
> if an interface goes down. I can give some more examples if needed.
I know this but thanks anyway for sharing, now it is on the mailing list.
I specifically implemented it such that it falls back to what we have
now when the state can't be determined.
> the /sys/class/net/$INTERFACE/operstate thingy seems not
> working on tap-devices ("unknown") but is fine with wifi.
Which is why I chose to just use the ethtool thingy, with the fallback
to what we have now.
More information about the Olsr-dev