networkd: link - improve link tracking logging
This commit is contained in:
parent
bc4bc52bc3
commit
393c0c5e64
|
@ -2140,7 +2140,7 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
|
||||||
|
|
||||||
r = address_new_dynamic(&address);
|
r = address_new_dynamic(&address);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return 0;
|
return r;
|
||||||
|
|
||||||
r = sd_rtnl_message_addr_get_family(message, &address->family);
|
r = sd_rtnl_message_addr_get_family(message, &address->family);
|
||||||
if (r < 0 || !IN_SET(address->family, AF_INET, AF_INET6)) {
|
if (r < 0 || !IN_SET(address->family, AF_INET, AF_INET6)) {
|
||||||
|
@ -2204,7 +2204,10 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
|
||||||
case RTM_NEWADDR:
|
case RTM_NEWADDR:
|
||||||
if (!address_dropped)
|
if (!address_dropped)
|
||||||
log_debug_link(link, "added address: %s/%u", buf,
|
log_debug_link(link, "added address: %s/%u", buf,
|
||||||
address->prefixlen);
|
address->prefixlen);
|
||||||
|
else
|
||||||
|
log_debug_link(link, "updated address: %s/%u", buf,
|
||||||
|
address->prefixlen);
|
||||||
|
|
||||||
LIST_PREPEND(addresses, link->addresses, address);
|
LIST_PREPEND(addresses, link->addresses, address);
|
||||||
address = NULL;
|
address = NULL;
|
||||||
|
@ -2215,10 +2218,12 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
|
||||||
case RTM_DELADDR:
|
case RTM_DELADDR:
|
||||||
if (address_dropped) {
|
if (address_dropped) {
|
||||||
log_debug_link(link, "removed address: %s/%u", buf,
|
log_debug_link(link, "removed address: %s/%u", buf,
|
||||||
address->prefixlen);
|
address->prefixlen);
|
||||||
|
|
||||||
link_save(link);
|
link_save(link);
|
||||||
}
|
} else
|
||||||
|
log_warning_link(link, "removing non-existent address: %s/%u",
|
||||||
|
buf, address->prefixlen);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue