summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFernando Fernandez Mancera <ffmancera@riseup.net>2023-08-14 12:39:52 +0200
committerFernando Fernandez Mancera <ffmancera@riseup.net>2023-08-14 12:39:52 +0200
commit9fab55ad4c0872ecff1377f83ff69ea6fb74e332 (patch)
tree29e467544ac2c1ae5357f008754f8405e48dafa1
parent995539cd30aafc8b96dd5bf946eeb453f598ce2a (diff)
parent68dc2d3ca96a87a53a6d7a383dd080e20ef82356 (diff)
l3cfg: merge branch 'bg/dad-failure-log-rh2123212'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1710
-rw-r--r--src/core/devices/nm-device.c14
-rw-r--r--src/core/nm-l3cfg.c14
-rw-r--r--src/core/nm-l3cfg.h1
3 files changed, 21 insertions, 8 deletions
diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c
index 5f1b057a38..47d17a200b 100644
--- a/src/core/devices/nm-device.c
+++ b/src/core/devices/nm-device.c
@@ -4247,6 +4247,20 @@ _dev_l3_cfg_notify_cb(NML3Cfg *l3cfg, const NML3ConfigNotifyData *notify_data, N
case NM_L3_CONFIG_NOTIFY_TYPE_ACD_EVENT:
{
const NML3AcdAddrInfo *addr_info = &notify_data->acd_event.info;
+ char buf_addr[NM_INET_ADDRSTRLEN];
+
+ if (addr_info->state == NM_L3_ACD_ADDR_STATE_USED) {
+ _LOGI(LOGD_DEVICE,
+ "IP address %s cannot be configured because it is already in use in the "
+ "network by host %s",
+ nm_inet4_ntop(addr_info->addr, buf_addr),
+ nm_ether_addr_to_string_a(&addr_info->last_conflict_addr));
+ } else if (addr_info->state == NM_L3_ACD_ADDR_STATE_CONFLICT) {
+ _LOGI(LOGD_DEVICE,
+ "conflict detected for IP address %s with host %s",
+ nm_inet4_ntop(addr_info->addr, buf_addr),
+ nm_ether_addr_to_string_a(&addr_info->last_conflict_addr));
+ }
if (addr_info->state > NM_L3_ACD_ADDR_STATE_PROBING)
_dev_ipmanual_check_ready(self);
diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c
index 3c2d3ec838..6b41d20f7b 100644
--- a/src/core/nm-l3cfg.c
+++ b/src/core/nm-l3cfg.c
@@ -101,8 +101,6 @@ typedef struct {
* timestamp when we start probing. */
guint32 probing_timeout_msec;
- NMEtherAddr last_conflict_addr;
-
NML3AcdDefendType acd_defend_type_desired : 3;
NML3AcdDefendType acd_defend_type_current : 3;
bool acd_defend_type_is_active : 1;
@@ -2663,8 +2661,8 @@ handle_init:
nm_assert(acd_data->info.state == NM_L3_ACD_ADDR_STATE_PROBING);
nm_assert(acd_data->nacd_probe);
- acd_data->nacd_probe = n_acd_probe_free(acd_data->nacd_probe);
- acd_data->last_conflict_addr = *sender_addr;
+ acd_data->nacd_probe = n_acd_probe_free(acd_data->nacd_probe);
+ acd_data->info.last_conflict_addr = *sender_addr;
_l3_acd_data_state_set_full(self,
acd_data,
NM_L3_ACD_ADDR_STATE_USED,
@@ -2676,7 +2674,7 @@ handle_init:
_l3_acd_data_timeout_schedule(acd_data, ACD_WAIT_TIME_PROBING_FULL_RESTART_MSEC);
if (!_l3_acd_data_defendconflict_warning_ratelimited(acd_data, p_now_msec)) {
- _LOGI("IPv4 address %s is used on network connected to interface %d%s%s%s from "
+ _LOGD("IPv4 address %s is used on network connected to interface %d%s%s%s from "
"host %s",
nm_inet4_ntop(acd_data->info.addr, sbuf_addr),
self->priv.ifindex,
@@ -2707,7 +2705,7 @@ handle_init:
nm_ether_addr_to_string_a(sender_addr));
if (!_l3_acd_data_defendconflict_warning_ratelimited(acd_data, p_now_msec)) {
- _LOGW("IPv4 address collision detection sees conflict on interface %d%s%s%s for "
+ _LOGD("IPv4 address collision detection sees conflict on interface %d%s%s%s for "
"address %s from host %s",
self->priv.ifindex,
NM_PRINT_FMT_QUOTED(self->priv.plobj_next,
@@ -2719,8 +2717,8 @@ handle_init:
nm_ether_addr_to_string_a(sender_addr));
}
- acd_data->nacd_probe = n_acd_probe_free(acd_data->nacd_probe);
- acd_data->last_conflict_addr = *sender_addr;
+ acd_data->nacd_probe = n_acd_probe_free(acd_data->nacd_probe);
+ acd_data->info.last_conflict_addr = *sender_addr;
_l3_acd_data_state_set(self, acd_data, NM_L3_ACD_ADDR_STATE_CONFLICT, TRUE);
if (!acd_data->acd_data_timeout_source)
_l3_acd_data_timeout_schedule(acd_data, ACD_WAIT_TIME_CONFLICT_RESTART_MSEC);
diff --git a/src/core/nm-l3cfg.h b/src/core/nm-l3cfg.h
index 5ee201e7a2..9b8ec67f02 100644
--- a/src/core/nm-l3cfg.h
+++ b/src/core/nm-l3cfg.h
@@ -92,6 +92,7 @@ typedef struct {
NML3AcdAddrState state;
NML3Cfg *l3cfg;
const NML3AcdAddrTrackInfo *track_infos;
+ NMEtherAddr last_conflict_addr;
} NML3AcdAddrInfo;
static inline const NML3AcdAddrTrackInfo *