]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
libsystemd-network: do not warn when log_dhcp_client() or friends with NULL
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 24 Oct 2021 19:48:39 +0000 (04:48 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 25 Oct 2021 23:09:40 +0000 (08:09 +0900)
src/libsystemd-network/network-common.h

index d43b76d4b8f16510f787dc4b6a26b8a14fd19940..2b0e3b5607615dabaffd7bd746eed3ae55ead66f 100644 (file)
@@ -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__);                         \