Question

Is there an interface in Linux to get notification of a network interface carrier change? I know its possible to poll an interface with SIOCETHTOOL, but was wondering if there was any way to get notified or any blocking calls that would return on carrier detection changes?

Was it helpful?

Solution

Do you need carrier transition or interface state change? For the interface state you could listen to the NETLINK_ROUTE netlink socket and wait for RTM_NEWLINK and RTM_DELLINK messages

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top