Medium: ethmonitor: correctly detect when the network is unplugged.
The ethmonitor does not return the correct status
1). when the wire is unplugged from network interface,
for example, the output for eth0 is: # ip -o link show up dev eth0 # eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state
DOWN qlen 1000
2). when lower layer is down for a VLAN, for example, the output:
- ip -o link show up dev vlan2
- vlan2@bond2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc
noqueue state LOWERLAYERDOWN
Solution:
both of the above status can be detected by 'grep NO-CARRIER'