From fbf0c191e16ba0f13bb90f6cbd90d80b62314434 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 3 Nov 2022 11:50:04 +0100 Subject: [PATCH] Fix operator priority (notably ternary ?: is less prioritized than <=) --- l2tpns.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/l2tpns.h b/l2tpns.h index b6eccf0..1cc2c3e 100644 --- a/l2tpns.h +++ b/l2tpns.h @@ -984,8 +984,8 @@ void lac_tunnelshutdown(tunnelidt t, char *reason, int result, int error, char * #undef LOG #undef LOG_HEX -#define LOG(D, s, t, f, ...) ({ if (D <= config->debug) _log(D, s, t, f, ## __VA_ARGS__); }) -#define LOG_HEX(D, t, d, s) ({ if (D <= config->debug) _log_hex(D, t, d, s); }) +#define LOG(D, s, t, f, ...) ({ if ((D) <= config->debug) _log((D), s, t, f, ## __VA_ARGS__); }) +#define LOG_HEX(D, t, d, s) ({ if ((D) <= config->debug) _log_hex((D), t, d, s); }) void _log(int level, sessionidt s, tunnelidt t, const char *format, ...) __attribute__((format (printf, 4, 5))); void _log_hex(int level, const char *title, const uint8_t *data, int maxsize);