From: Renato Westphal Date: Fri, 21 Jul 2017 18:09:58 +0000 (-0300) Subject: zebra: fetch interface speed on *BSD X-Git-Tag: frr-4.0-dev~439^2~14 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=04427fcb48cbe2c9c312c8a8e0270c2bf6265ad1;p=mirror%2Ffrr.git zebra: fetch interface speed on *BSD Fixes #407 for FreeBSD and NetBSD. OpenBSD uses ioctl to fetch interface information on startup and the SIOCGIFMEDIA command is just too cumbersome to use. The best way to fix the problem for OpenBSD is probably to stop treating it differently from the other BSDs for no apparent reason. There should be nothing preventing us to make OpenBSD use the routing socket to fetch interface information on startup (we already do it to detect runtime changes). This is something that should be done in a separate commit after a careful analysis. Signed-off-by: Renato Westphal --- diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c index 5df57b2530..5ca6a488c3 100644 --- a/zebra/kernel_socket.c +++ b/zebra/kernel_socket.c @@ -627,6 +627,7 @@ int ifm_read(struct if_msghdr *ifm) #ifdef HAVE_NET_RT_IFLIST ifp->stats = ifm->ifm_data; #endif /* HAVE_NET_RT_IFLIST */ + ifp->speed = ifm->ifm_data.ifi_baudrate / 1000000; if (IS_ZEBRA_DEBUG_KERNEL) zlog_debug("%s: interface %s index %d", __func__, ifp->name,