summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-20 13:08:59 +0200
committerTom Gundersen <teg@jklm.no>2014-04-20 19:20:26 +0200
commitc6a1eb79a52a29ddb80bc2b58f44a86a33e9f027 (patch)
tree780c2f8e04986385de844c65db30a315c870a17f
parent75ee87c8c61817a94e520cf1ec564996b3781b89 (diff)
networkd: link - log changes in some common link flags
-rw-r--r--src/network/networkd-link.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index d24168227c..8c6bad4de3 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1059,7 +1059,9 @@ static int link_update_flags(Link *link, unsigned flags) {
flags_added = (link->flags ^ flags) & flags;
flags_removed = (link->flags ^ flags) & link->flags;
- generic_flags = ~(IFF_UP | IFF_LOWER_UP | IFF_DORMANT);
+ generic_flags = ~(IFF_UP | IFF_LOWER_UP | IFF_DORMANT | IFF_DEBUG |
+ IFF_MULTICAST | IFF_BROADCAST | IFF_PROMISC |
+ IFF_NOARP | IFF_MASTER | IFF_SLAVE);
/* consider link to have carrier when LOWER_UP and !DORMANT
@@ -1096,6 +1098,41 @@ static int link_update_flags(Link *link, unsigned flags) {
else if (flags_removed & IFF_DORMANT)
log_debug_link(link, "link is not dormant");
+ if (flags_added & IFF_DEBUG)
+ log_debug_link(link, "debugging enabled in the kernel");
+ else if (flags_removed & IFF_DEBUG)
+ log_debug_link(link, "debugging disabled in the kernel");
+
+ if (flags_added & IFF_MULTICAST)
+ log_debug_link(link, "multicast enabled");
+ else if (flags_removed & IFF_MULTICAST)
+ log_debug_link(link, "multicast disabled");
+
+ if (flags_added & IFF_BROADCAST)
+ log_debug_link(link, "broadcast enabled");
+ else if (flags_removed & IFF_BROADCAST)
+ log_debug_link(link, "broadcast disabled");
+
+ if (flags_added & IFF_PROMISC)
+ log_debug_link(link, "promiscuous mode enabled");
+ else if (flags_removed & IFF_PROMISC)
+ log_debug_link(link, "promiscuous mode disabled");
+
+ if (flags_added & IFF_NOARP)
+ log_debug_link(link, "ARP protocol disabled");
+ else if (flags_removed & IFF_NOARP)
+ log_debug_link(link, "ARP protocol enabled");
+
+ if (flags_added & IFF_MASTER)
+ log_debug_link(link, "link is master");
+ else if (flags_removed & IFF_MASTER)
+ log_debug_link(link, "link is no longer master");
+
+ if (flags_added & IFF_SLAVE)
+ log_debug_link(link, "link is slave");
+ else if (flags_removed & IFF_SLAVE)
+ log_debug_link(link, "link is no longer slave");
+
/* link flags are currently at most 18 bits, let's default to printing 20 */
if (flags_added & generic_flags)
log_debug_link(link, "unknown link flags gained: %#.5x (ignoring)",