]> git.puffer.fish Git - matthieu/frr.git/commitdiff
disable logs for fuzzing
authorQuentin Young <qlyoung@cumulusnetworks.com>
Sat, 11 Jan 2020 20:17:48 +0000 (15:17 -0500)
committerQuentin Young <qlyoung@nvidia.com>
Mon, 15 Nov 2021 19:52:42 +0000 (14:52 -0500)
lib/zlog.h

index 6e84fe892372dd6f7fdce33989ad6a426a79405e..3cd4edcc6dea2ff03fabdfd024b13f447e44c7c0 100644 (file)
@@ -120,6 +120,8 @@ static inline void zlog_ref(const struct xref_logmsg *xref,
                zlog_ref(&_xref, (msg), ##__VA_ARGS__);                        \
        } while (0)
 
+#ifndef FUZZING
+
 #define zlog_err(...)    _zlog_ecref(0, LOG_ERR, __VA_ARGS__)
 #define zlog_warn(...)   _zlog_ecref(0, LOG_WARNING, __VA_ARGS__)
 #define zlog_info(...)   _zlog_ecref(0, LOG_INFO, __VA_ARGS__)
@@ -134,6 +136,20 @@ static inline void zlog_ref(const struct xref_logmsg *xref,
 #define flog_err_sys(ferr_id, format, ...)                                     \
        _zlog_ecref(ferr_id, LOG_ERR, format, ## __VA_ARGS__)
 
+#else
+
+#define zlog_err(...) 0
+#define zlog_warn(...) 0
+#define zlog_info(...) 0
+#define zlog_notice(...) 0
+#define zlog_debug(...) 0
+
+#define flog_err(ferr_id, format, ...) 0
+#define flog_warn(ferr_id, format, ...) 0
+#define flog_err_sys(ferr_id, format, ...) 0
+
+#endif
+
 extern void zlog_sigsafe(const char *text, size_t len);
 
 /* extra priority value to disable a target without deleting it */