]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: handle FreeBSD routing socket ENOBUFS
authorRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 1 Jul 2022 13:00:25 +0000 (10:00 -0300)
committerRafael Zalamena <rzalamena@opensourcerouting.org>
Fri, 1 Jul 2022 13:21:41 +0000 (10:21 -0300)
This is a slightly modified version of Hiroki Sato's version:
https://github.com/hrs-allbsd/frr/commit/9ca79c941fd84322199994a2aed267b23d39c86a

Handle the `ENOBUFS` on a OS basis since it could have been implemented
differently (OpenBSD for an example uses `RTM_DESYNC`).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
zebra/kernel_socket.c

index 57fd304ae8d0292bf7bf946ec60e2eee153f0743..2741a2324230057ce072fe1a253157c7dc85b7f5 100644 (file)
@@ -1354,6 +1354,16 @@ static void kernel_read(struct thread *thread)
 
        if (nbytes < 0) {
                if (errno == ENOBUFS) {
+#ifdef __FreeBSD__
+                       /*
+                        * ENOBUFS indicates a temporary resource
+                        * shortage and is not harmful for consistency of
+                        * reading the routing socket.  Ignore it.
+                        */
+                       thread_add_read(zrouter.master, kernel_read, NULL, sock,
+                                       NULL);
+                       return;
+#else
                        flog_err(EC_ZEBRA_RECVMSG_OVERRUN,
                                 "routing socket overrun: %s",
                                 safe_strerror(errno));
@@ -1363,6 +1373,7 @@ static void kernel_read(struct thread *thread)
                         *  recover zebra at this point.
                         */
                        exit(-1);
+#endif
                }
                if (errno != EAGAIN && errno != EWOULDBLOCK)
                        flog_err_sys(EC_LIB_SOCKET, "routing socket error: %s",