]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virNetDevGetLinkInfo: Don't report link speed if NIC's not up
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 13 Jun 2014 09:29:48 +0000 (11:29 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 13 Jun 2014 09:29:48 +0000 (11:29 +0200)
commit90ba5ef1bb005cd4bbe0e764174b934c4a1cf426
treebff818d6ef8250ec04e484ceeaae2e9db1eb676e
parent51c439056b4bef3d704b1ae86d0a7304e4df3608
virNetDevGetLinkInfo: Don't report link speed if NIC's not up

The kernel's more broken than one would think. Various drivers report
various (usually spurious) values if the interface is in other state
than 'up' . While on some we experience -EINVAL when read()-ing the
speed sysfs file, with other drivers we might get anything from 0 to
UINT_MAX. If that's the case it's better to not report link speed.
Well, the interface is not up anyway.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/util/virnetdev.c