From 04427fcb48cbe2c9c312c8a8e0270c2bf6265ad1 Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 21 Jul 2017 15:09:58 -0300 Subject: [PATCH] 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 --- zebra/kernel_socket.c | 1 + 1 file changed, 1 insertion(+) 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, -- 2.39.5