mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-04-24 18:30:44 +02:00
logging: add "VLAN" log domain
This commit is contained in:
parent
8437b07581
commit
1eb9c5e352
3 changed files with 13 additions and 10 deletions
|
|
@ -46,7 +46,8 @@
|
|||
LOGD_IP6 | LOGD_AUTOIP4 | LOGD_DNS | LOGD_VPN | LOGD_SHARING | \
|
||||
LOGD_SUPPLICANT | LOGD_AGENTS | LOGD_SETTINGS | LOGD_SUSPEND | \
|
||||
LOGD_CORE | LOGD_DEVICE | LOGD_OLPC_MESH | LOGD_WIMAX | \
|
||||
LOGD_INFINIBAND | LOGD_FIREWALL | LOGD_ADSL | LOGD_BOND)
|
||||
LOGD_INFINIBAND | LOGD_FIREWALL | LOGD_ADSL | LOGD_BOND | \
|
||||
LOGD_VLAN)
|
||||
|
||||
static guint32 log_level = LOGL_INFO | LOGL_WARN | LOGL_ERR;
|
||||
static guint32 log_domains = LOGD_ALL & ~LOGD_WIFI_SCAN;
|
||||
|
|
@ -94,6 +95,7 @@ static const LogDesc domain_descs[] = {
|
|||
{ LOGD_FIREWALL, "FIREWALL" },
|
||||
{ LOGD_ADSL, "ADSL" },
|
||||
{ LOGD_BOND, "BOND" },
|
||||
{ LOGD_VLAN, "VLAN" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ enum {
|
|||
LOGD_FIREWALL = 0x02000000,
|
||||
LOGD_ADSL = 0x04000000,
|
||||
LOGD_BOND = 0x08000000,
|
||||
LOGD_VLAN = 0x10000000,
|
||||
};
|
||||
|
||||
#define LOGD_DHCP (LOGD_DHCP4 | LOGD_DHCP6)
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ get_carrier_sync (NMDeviceVlan *self)
|
|||
nm_device_get_ip_ifindex (NM_DEVICE (self)),
|
||||
&ifflags,
|
||||
&error)) {
|
||||
nm_log_warn (LOGD_HW | LOGD_DEVICE,
|
||||
nm_log_warn (LOGD_HW | LOGD_VLAN,
|
||||
"(%s): couldn't get carrier state: (%d) %s",
|
||||
nm_device_get_ip_iface (NM_DEVICE (self)),
|
||||
error ? error->code : -1,
|
||||
|
|
@ -178,7 +178,7 @@ update_hw_address (NMDevice *dev)
|
|||
|
||||
rtnl = nm_netlink_index_to_rtnl_link (nm_device_get_ip_ifindex (dev));
|
||||
if (!rtnl) {
|
||||
nm_log_err (LOGD_HW | LOGD_DEVICE,
|
||||
nm_log_err (LOGD_HW | LOGD_VLAN,
|
||||
"(%s) failed to read hardware address (error %d)",
|
||||
nm_device_get_iface (dev), errno);
|
||||
return;
|
||||
|
|
@ -186,14 +186,14 @@ update_hw_address (NMDevice *dev)
|
|||
|
||||
addr = rtnl_link_get_addr (rtnl);
|
||||
if (!addr) {
|
||||
nm_log_err (LOGD_HW | LOGD_DEVICE,
|
||||
nm_log_err (LOGD_HW | LOGD_VLAN,
|
||||
"(%s) no hardware address?",
|
||||
nm_device_get_iface (dev));
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (nl_addr_get_len (addr) > sizeof (priv->hw_addr)) {
|
||||
nm_log_err (LOGD_HW | LOGD_DEVICE,
|
||||
nm_log_err (LOGD_HW | LOGD_VLAN,
|
||||
"(%s) hardware address is wrong length (got %d max %zd)",
|
||||
nm_device_get_iface (dev),
|
||||
nl_addr_get_len (addr),
|
||||
|
|
@ -521,7 +521,7 @@ set_carrier (NMDeviceVlan *self,
|
|||
g_object_notify (G_OBJECT (self), NM_DEVICE_VLAN_CARRIER);
|
||||
|
||||
state = nm_device_get_state (NM_DEVICE (self));
|
||||
nm_log_info (LOGD_HW | LOGD_DEVICE,
|
||||
nm_log_info (LOGD_HW | LOGD_VLAN,
|
||||
"(%s): carrier now %s (device state %d%s)",
|
||||
nm_device_get_iface (NM_DEVICE (self)),
|
||||
carrier ? "ON" : "OFF",
|
||||
|
|
@ -577,7 +577,7 @@ carrier_watch_init (NMDeviceVlan *self)
|
|||
|
||||
priv->carrier = get_carrier_sync (NM_DEVICE_VLAN (self));
|
||||
|
||||
nm_log_info (LOGD_HW | LOGD_DEVICE, "(%s): carrier is %s",
|
||||
nm_log_info (LOGD_HW | LOGD_VLAN, "(%s): carrier is %s",
|
||||
nm_device_get_iface (NM_DEVICE (self)),
|
||||
priv->carrier ? "ON" : "OFF");
|
||||
|
||||
|
|
@ -637,13 +637,13 @@ nm_device_vlan_new (const char *udi, const char *iface, NMDevice *parent)
|
|||
|
||||
itype = nm_system_get_iface_type (ifindex, iface);
|
||||
if (itype != NM_IFACE_TYPE_VLAN) {
|
||||
nm_log_err (LOGD_DEVICE, "(%s): failed to get VLAN interface type.", iface);
|
||||
nm_log_err (LOGD_VLAN, "(%s): failed to get VLAN interface type.", iface);
|
||||
g_object_unref (device);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!nm_system_get_iface_vlan_info (ifindex, &parent_ifindex, &vlan_id)) {
|
||||
nm_log_warn (LOGD_DEVICE, "(%s): failed to get VLAN interface info.", iface);
|
||||
nm_log_warn (LOGD_VLAN, "(%s): failed to get VLAN interface info.", iface);
|
||||
g_object_unref (device);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -651,7 +651,7 @@ nm_device_vlan_new (const char *udi, const char *iface, NMDevice *parent)
|
|||
if ( parent_ifindex < 0
|
||||
|| parent_ifindex != nm_device_get_ip_ifindex (parent)
|
||||
|| vlan_id < 0) {
|
||||
nm_log_warn (LOGD_DEVICE, "(%s): VLAN parent ifindex (%d) or VLAN ID (%d) invalid.",
|
||||
nm_log_warn (LOGD_VLAN, "(%s): VLAN parent ifindex (%d) or VLAN ID (%d) invalid.",
|
||||
iface, parent_ifindex, priv->vlan_id);
|
||||
g_object_unref (device);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue