tMC
tMC

Reputation: 19335

Linux carrier detection notification

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?

Upvotes: 2

Views: 974

Answers (1)

msh
msh

Reputation: 2770

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

Upvotes: 2

Related Questions