mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-15 15:04:00 +00:00
zebra: don't log errors on unsupported medias
When using `SIOCGIFMEDIA` check for `EINVAL`, otherwise we might print
an error message on an unsupported interface.
FreeBSD source code reference:
https://github.com/freebsd/freebsd/blob/master/sys/net/if_media.c#L300
And:
8cb4b0c018/usr.sbin/rtsold/if.c (L211)
/*
* EINVAL simply means that the interface does not support
* the SIOCGIFMEDIA ioctl. We regard it alive.
*/
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
86c57af534
commit
c69f2c1fff
@ -415,7 +415,8 @@ void if_get_flags(struct interface *ifp)
|
||||
strncpy(ifmr.ifm_name, ifp->name, IFNAMSIZ);
|
||||
|
||||
/* Seems not all interfaces implement this ioctl */
|
||||
if (if_ioctl(SIOCGIFMEDIA, (caddr_t)&ifmr) < 0)
|
||||
if (if_ioctl(SIOCGIFMEDIA, (caddr_t)&ifmr) == -1 &&
|
||||
errno != EINVAL)
|
||||
flog_err_sys(EC_LIB_SYSTEM_CALL,
|
||||
"if_ioctl(SIOCGIFMEDIA) failed: %s",
|
||||
safe_strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user