Re: Dummy Q: How's the NetworkManager knows link is down ?



On Sat, 2012-01-21 at 13:30 +0000, ning ji wrote:
> Say i unplug the ethernet cable,
> "ifconfig eth0" still says up without NetworkManager.

The UP flag doesn't actually have anything to do with the interface's
carrier state, it's more about higher level protocols.  If you're
interested in the carrier state, look for LOWER_UP which tracks the L1
state.

> But with NetworkManager, it can show you the link is disconnected.

NM listens to kernel netlink events for each network interface, looking
to see if the IFF_LOWER_UP flag changes.  Calling netif_set_carrier() in
the kernel driver code will cause these events to be emitted.

Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]