mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-08 15:20:19 +01:00
arping: print IP address conflicts
Print a warning whenever we find a IP conflict on the network. In the future we may export a flag on the device or send a signal so that clients can notify the user of the conflict.
This commit is contained in:
parent
ac8618c78f
commit
df488184a8
1 changed files with 14 additions and 0 deletions
|
|
@ -179,6 +179,7 @@ acd_event (GIOChannel *source, GIOCondition condition, gpointer data)
|
|||
NMArpingManagerPrivate *priv = NM_ARPING_MANAGER_GET_PRIVATE (self);
|
||||
NAcdEvent *event;
|
||||
char address_str[INET_ADDRSTRLEN];
|
||||
gs_free char *hwaddr_str = NULL;
|
||||
int r;
|
||||
|
||||
if ( n_acd_dispatch (info->acd)
|
||||
|
|
@ -204,6 +205,19 @@ acd_event (GIOChannel *source, GIOCondition condition, gpointer data)
|
|||
case N_ACD_EVENT_USED:
|
||||
info->duplicate = TRUE;
|
||||
break;
|
||||
case N_ACD_EVENT_DEFENDED:
|
||||
_LOGD ("defended address %s from host %s",
|
||||
nm_utils_inet4_ntop (info->address, address_str),
|
||||
(hwaddr_str = nm_utils_hwaddr_ntoa (event->defended.sender,
|
||||
event->defended.n_sender)));
|
||||
break;
|
||||
case N_ACD_EVENT_CONFLICT:
|
||||
_LOGW ("conflict for address %s detected with host %s on interface '%s'",
|
||||
nm_utils_inet4_ntop (info->address, address_str),
|
||||
(hwaddr_str = nm_utils_hwaddr_ntoa (event->defended.sender,
|
||||
event->defended.n_sender)),
|
||||
nm_platform_link_get_name (NM_PLATFORM_GET, priv->ifindex));
|
||||
break;
|
||||
default:
|
||||
_LOGD ("event '%s' for address %s",
|
||||
acd_event_to_string (event->event),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue