summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-03-05 10:56:16 +0100
committerThomas Haller <thaller@redhat.com>2014-03-13 21:40:42 +0100
commite7daeeecb48f25bf7f623e3f1b20e6709c2de83a (patch)
tree01b8a5647c8289fa8ba01d4c7084cfc11cbc3d4e
parent2331f9b00d27ab67aeaa2417ea40a74670b141b6 (diff)
downloadNetworkManager-e7daeeecb48f25bf7f623e3f1b20e6709c2de83a.tar.gz
platform: add logging for adding/changing links
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r--src/platform/nm-linux-platform.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 4b23f56787..5f80bc36c6 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -1775,6 +1775,9 @@ link_add (NMPlatform *platform, const char *name, NMLinkType type)
r = system ("modprobe bonding max_bonds=0");
}
+ debug ("link: add link '%s' of type '%s' (%d)",
+ name, type_to_string (type), (int) type);
+
return add_object (platform, build_rtnl_link (0, name, type));
}
@@ -1939,6 +1942,13 @@ link_change_flags (NMPlatform *platform, int ifindex, unsigned int flags, gboole
else
rtnl_link_unset_flags (change, flags);
+ if (nm_logging_enabled (LOGL_DEBUG, LOGD_PLATFORM)) {
+ char buf[512];
+
+ rtnl_link_flags2str (flags, buf, sizeof (buf));
+ debug ("link: change %d: flags %s '%s' (%d)", ifindex, value ? "set" : "unset", buf, flags);
+ }
+
return link_change (platform, ifindex, change);
}
@@ -2082,6 +2092,13 @@ link_set_address (NMPlatform *platform, int ifindex, gconstpointer address, size
rtnl_link_set_addr (change, nladdr);
+ if (nm_logging_enabled (LOGL_DEBUG, LOGD_PLATFORM)) {
+ char *mac = nm_utils_hwaddr_ntoa_len (address, length);
+
+ debug ("link: change %d: address %s (%lu bytes)", ifindex, mac, (unsigned long) length);
+ g_free (mac);
+ }
+
return link_change (platform, ifindex, change);
}
@@ -2107,6 +2124,8 @@ link_set_mtu (NMPlatform *platform, int ifindex, guint32 mtu)
g_return_val_if_fail (change != NULL, FALSE);
rtnl_link_set_mtu (change, mtu);
+ debug ("link: change %d: mtu %lu", ifindex, (unsigned long)mtu);
+
return link_change (platform, ifindex, change);
}
@@ -2154,6 +2173,9 @@ vlan_add (NMPlatform *platform, const char *name, int parent, int vlan_id, guint
rtnl_link_vlan_set_id (rtnllink, vlan_id);
rtnl_link_vlan_set_flags (rtnllink, kernel_flags);
+ debug ("link: add vlan '%s', parent %d, vlan id %d, flags %X (native: %X)",
+ name, parent, vlan_id, (unsigned int) vlan_flags, kernel_flags);
+
return add_object (platform, object);
}
@@ -2183,6 +2205,8 @@ vlan_set_ingress_map (NMPlatform *platform, int ifindex, int from, int to)
return FALSE;
rtnl_link_vlan_set_ingress_map (change, from, to);
+ debug ("link: change %d: vlan ingress map %d -> %d", ifindex, from, to);
+
return link_change (platform, ifindex, change);
}
@@ -2195,6 +2219,8 @@ vlan_set_egress_map (NMPlatform *platform, int ifindex, int from, int to)
return FALSE;
rtnl_link_vlan_set_egress_map (change, from, to);
+ debug ("link: change %d: vlan egress map %d -> %d", ifindex, from, to);
+
return link_change (platform, ifindex, change);
}
@@ -2207,6 +2233,8 @@ link_enslave (NMPlatform *platform, int master, int slave)
rtnl_link_set_master (change, master);
+ debug ("link: change %d: enslave to master %d", slave, master);
+
return link_change (platform, slave, change);
}