]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/if_sysctl.c
isisd: implement the 'lsp-too-large' notification
[mirror_frr.git] / zebra / if_sysctl.c
index 99b0f9d942fb88f117749f4d912b7bdcc958d9ba..44afd266bc1e1bfc0b0d8354163cf79c8aaa4ac4 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <zebra.h>
 
+#if !defined(GNU_LINUX) && !defined(OPEN_BSD) && !defined(SUNOS_5)
+
 #include "if.h"
 #include "sockunion.h"
 #include "prefix.h"
@@ -35,6 +37,7 @@
 #include "zebra/rt.h"
 #include "zebra/kernel_socket.h"
 #include "zebra/rib.h"
+#include "zebra/zebra_errors.h"
 
 void ifstat_update_sysctl(void)
 {
@@ -50,16 +53,18 @@ void ifstat_update_sysctl(void)
 
        /* Query buffer size. */
        if (sysctl(mib, MIBSIZ, NULL, &bufsiz, NULL, 0) < 0) {
-               zlog_warn("sysctl() error by %s", safe_strerror(errno));
+               flog_warn(EC_ZEBRA_SYSCTL_FAILED, "sysctl() error by %s",
+                         safe_strerror(errno));
                return;
        }
 
        /* We free this memory at the end of this function. */
        ref = buf = XMALLOC(MTYPE_TMP, bufsiz);
 
-       /* Fetch interface informations into allocated buffer. */
+       /* Fetch interface information into allocated buffer. */
        if (sysctl(mib, MIBSIZ, buf, &bufsiz, NULL, 0) < 0) {
-               zlog_warn("sysctl error by %s", safe_strerror(errno));
+               flog_warn(EC_ZEBRA_SYSCTL_FAILED, "sysctl error by %s",
+                         safe_strerror(errno));
                XFREE(MTYPE_TMP, ref);
                return;
        }
@@ -93,22 +98,26 @@ void interface_list(struct zebra_ns *zns)
                NET_RT_IFLIST, 0};
 
        if (zns->ns_id != NS_DEFAULT) {
-               zlog_warn("interface_list: ignore NS %u", zns->ns_id);
+               zlog_debug("interface_list: ignore NS %u", zns->ns_id);
                return;
        }
 
        /* Query buffer size. */
        if (sysctl(mib, MIBSIZ, NULL, &bufsiz, NULL, 0) < 0) {
-               zlog_warn("sysctl() error by %s", safe_strerror(errno));
+               flog_err_sys(EC_ZEBRA_IFLIST_FAILED,
+                            "Could not enumerate interfaces: %s",
+                            safe_strerror(errno));
                return;
        }
 
        /* We free this memory at the end of this function. */
        ref = buf = XMALLOC(MTYPE_TMP, bufsiz);
 
-       /* Fetch interface informations into allocated buffer. */
+       /* Fetch interface information into allocated buffer. */
        if (sysctl(mib, MIBSIZ, buf, &bufsiz, NULL, 0) < 0) {
-               zlog_warn("sysctl error by %s", safe_strerror(errno));
+               flog_err_sys(EC_ZEBRA_IFLIST_FAILED,
+                            "Could not enumerate interfaces: %s",
+                            safe_strerror(errno));
                return;
        }
 
@@ -134,3 +143,5 @@ void interface_list(struct zebra_ns *zns)
        /* Free sysctl buffer. */
        XFREE(MTYPE_TMP, ref);
 }
+
+#endif /* !defined(GNU_LINUX) && !defined(OPEN_BSD) && !defined(SUNOS_5) */