sd-ipv4acd,sd-ipv4ll: include interface name in the debug logs

This commit is contained in:
Yu Watanabe 2020-12-02 15:21:35 +09:00
parent 1f1d4d42c1
commit 3f2c0d8520
2 changed files with 10 additions and 5 deletions

View File

@ -18,6 +18,7 @@
#include "fd-util.h"
#include "format-util.h"
#include "in-addr-util.h"
#include "log-link.h"
#include "random-util.h"
#include "siphash24.h"
#include "string-util.h"
@ -73,8 +74,10 @@ struct sd_ipv4acd {
void* userdata;
};
#define log_ipv4acd_errno(acd, error, fmt, ...) log_internal(LOG_DEBUG, error, PROJECT_FILE, __LINE__, __func__, "IPV4ACD: " fmt, ##__VA_ARGS__)
#define log_ipv4acd(acd, fmt, ...) log_ipv4acd_errno(acd, 0, fmt, ##__VA_ARGS__)
#define log_ipv4acd_errno(acd, error, fmt, ...) \
log_interface_full_errno(sd_ipv4acd_get_ifname(acd), LOG_DEBUG, error, "IPV4ACD: " fmt, ##__VA_ARGS__)
#define log_ipv4acd(acd, fmt, ...) \
log_ipv4acd_errno(acd, 0, fmt, ##__VA_ARGS__)
static void ipv4acd_set_state(sd_ipv4acd *acd, IPv4ACDState st, bool reset_counter) {
assert(acd);

View File

@ -15,7 +15,7 @@
#include "alloc-util.h"
#include "ether-addr-util.h"
#include "in-addr-util.h"
#include "list.h"
#include "log-link.h"
#include "random-util.h"
#include "siphash24.h"
#include "sparse-endian.h"
@ -49,8 +49,10 @@ struct sd_ipv4ll {
void* userdata;
};
#define log_ipv4ll_errno(ll, error, fmt, ...) log_internal(LOG_DEBUG, error, PROJECT_FILE, __LINE__, __func__, "IPV4LL: " fmt, ##__VA_ARGS__)
#define log_ipv4ll(ll, fmt, ...) log_ipv4ll_errno(ll, 0, fmt, ##__VA_ARGS__)
#define log_ipv4ll_errno(ll, error, fmt, ...) \
log_interface_full_errno(sd_ipv4ll_get_ifname(ll), LOG_DEBUG, error, "IPV4LL: " fmt, ##__VA_ARGS__)
#define log_ipv4ll(ll, fmt, ...) \
log_ipv4ll_errno(ll, 0, fmt, ##__VA_ARGS__)
static void ipv4ll_on_acd(sd_ipv4acd *ll, int event, void *userdata);