From a84171ce6f9a661b9999cac644b117fe4396bf79 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 25 Oct 2021 04:48:39 +0900 Subject: [PATCH] libsystemd-network: do not warn when log_dhcp_client() or friends with NULL --- src/libsystemd-network/network-common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libsystemd-network/network-common.h b/src/libsystemd-network/network-common.h index d43b76d4b8..2b0e3b5607 100644 --- a/src/libsystemd-network/network-common.h +++ b/src/libsystemd-network/network-common.h @@ -8,8 +8,10 @@ int _e = (error); \ if (DEBUG_LOGGING) { \ const char *_n = NULL; \ + type *_v = (val); \ \ - (void) type##_get_ifname(val, &_n); \ + if (_v) \ + (void) type##_get_ifname(_v, &_n); \ log_interface_full_errno_zerook( \ _n, LOG_DEBUG, _e, prefix fmt, \ ##__VA_ARGS__); \