systemd/0004-networkd-link-improve-link-tracking-logging.patch
2014-07-19 15:47:59 -04:00

51 lines
2.2 KiB
Diff

From a8e0b3dcb6cb021193f7ab71e94bcc554cfd0348 Mon Sep 17 00:00:00 2001
From: Tom Gundersen <teg@jklm.no>
Date: Thu, 3 Jul 2014 21:35:03 +0200
Subject: [PATCH] networkd: link - improve link tracking logging
(cherry picked from commit 393c0c5e64d0cb85ce14f25a06fa8958c9e119e7)
---
src/network/networkd-link.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 14c0417d83..961c1ab8ad 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -2140,7 +2140,7 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
r = address_new_dynamic(&address);
if (r < 0)
- return 0;
+ return r;
r = sd_rtnl_message_addr_get_family(message, &address->family);
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:
if (!address_dropped)
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);
address = NULL;
@@ -2215,10 +2218,12 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message, void *use
case RTM_DELADDR:
if (address_dropped) {
log_debug_link(link, "removed address: %s/%u", buf,
- address->prefixlen);
+ address->prefixlen);
link_save(link);
- }
+ } else
+ log_warning_link(link, "removing non-existent address: %s/%u",
+ buf, address->prefixlen);
break;
default: