* Alignment of zero-sized sockaddrs is nonsensical, but historically
* BSD defines RT_ROUNDUP(0) to be the alignment interval (rather than
* 0). We follow this practice without questioning it, but it is a
- * bug if quagga calls ROUNDUP with 0.
+ * bug if frr calls ROUNDUP with 0.
*/
#ifdef __APPLE__
#define ROUNDUP_TYPE int
__func__, ifan->ifan_index, ifan->ifan_name);
/* Create Interface */
- ifp = if_get_by_name(ifan->ifan_name, VRF_DEFAULT);
+ ifp = if_get_by_name(ifan->ifan_name, VRF_DEFAULT,
+ VRF_DEFAULT_NAME);
if_set_index(ifp, ifan->ifan_index);
if_get_metric(ifp);
if (ifp == NULL) {
/* Interface that zebra was not previously aware of, so
* create. */
- ifp = if_create_name(ifname, VRF_DEFAULT);
+ ifp = if_get_by_name(ifname, VRF_DEFAULT,
+ VRF_DEFAULT_NAME);
if (IS_ZEBRA_DEBUG_KERNEL)
zlog_debug("%s: creating ifp for ifindex %d",
__func__, ifm->ifm_index);
|| rtm->rtm_type == RTM_CHANGE)
rib_add(afi, SAFI_UNICAST, VRF_DEFAULT, ZEBRA_ROUTE_KERNEL, 0,
zebra_flags, &p, NULL, &nh, 0, RT_TABLE_MAIN,
- 0, 0, 0, 0);
+ 0, 0, 0, 0, false);
else
rib_delete(afi, SAFI_UNICAST, VRF_DEFAULT, ZEBRA_ROUTE_KERNEL,
0, zebra_flags, &p, NULL, &nh, 0, RT_TABLE_MAIN, 0,
#endif /* RTAX_MAX */
/* Kernel routing table and interface updates via routing socket. */
-static int kernel_read(struct thread *thread)
+static void kernel_read(struct thread *thread)
{
int sock;
int nbytes;
if (errno != EAGAIN && errno != EWOULDBLOCK)
flog_err_sys(EC_LIB_SOCKET, "routing socket error: %s",
safe_strerror(errno));
- return 0;
+ return;
}
if (nbytes == 0)
- return 0;
+ return;
thread_add_read(zrouter.master, kernel_read, NULL, sock, NULL);
zlog_debug(
"kernel_read: rtm->rtm_msglen %d, nbytes %d, type %d",
rtm->rtm_msglen, nbytes, rtm->rtm_type);
- return -1;
+ return;
}
switch (rtm->rtm_type) {
zlog_debug("Unprocessed RTM_type: %d", rtm->rtm_type);
break;
}
- return 0;
}
/* Make routing socket. */
return;
}
+/*
+ * Global init for platform-/OS-specific things
+ */
+void kernel_router_init(void)
+{
+}
+
+/*
+ * Global deinit for platform-/OS-specific things
+ */
+void kernel_router_terminate(void)
+{
+}
+
/*
* Called by the dplane pthread to read incoming OS messages and dispatch them.
*/