diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 6c9f93808c..e5290e796d 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -10676,6 +10676,7 @@ _dev_ipdhcpx_start(NMDevice *self, int addr_family) .addr_family = AF_INET, .l3cfg = nm_device_get_l3cfg(self), .iface = nm_device_get_ip_iface(self), + .iface_type_log = nm_device_get_type_desc_for_log(self), .uuid = nm_connection_get_uuid(connection), .hwaddr = hwaddr, .bcast_hwaddr = bcast_hwaddr, @@ -10713,6 +10714,7 @@ _dev_ipdhcpx_start(NMDevice *self, int addr_family) .addr_family = AF_INET6, .l3cfg = nm_device_get_l3cfg(self), .iface = nm_device_get_ip_iface(self), + .iface_type_log = nm_device_get_type_desc_for_log(self), .uuid = nm_connection_get_uuid(connection), .send_hostname = nm_setting_ip_config_get_dhcp_send_hostname(s_ip), .hostname = nm_setting_ip_config_get_dhcp_hostname(s_ip), diff --git a/src/core/dhcp/nm-dhcp-client.c b/src/core/dhcp/nm-dhcp-client.c index b10ce41063..6978bd3cb0 100644 --- a/src/core/dhcp/nm-dhcp-client.c +++ b/src/core/dhcp/nm-dhcp-client.c @@ -196,6 +196,14 @@ nm_dhcp_client_get_iface(NMDhcpClient *self) return priv->config.iface; } +const char * +nm_dhcp_client_get_iface_type_for_log(NMDhcpClient *self) +{ + NMDhcpClientPrivate *priv = NM_DHCP_CLIENT_GET_PRIVATE(self); + + return priv->config.iface_type_log; +} + NMDedupMultiIndex * nm_dhcp_client_get_multi_idx(NMDhcpClient *self) { @@ -1823,6 +1831,7 @@ config_init(NMDhcpClientConfig *config, const NMDhcpClientConfig *src) nm_g_bytes_ref(config->client_id); config->iface = g_strdup(config->iface); + config->iface_type_log = g_strdup(config->iface_type_log); config->uuid = g_strdup(config->uuid); config->anycast_address = g_strdup(config->anycast_address); config->hostname = g_strdup(config->hostname); @@ -1885,6 +1894,7 @@ config_clear(NMDhcpClientConfig *config) nm_clear_pointer(&config->client_id, g_bytes_unref); nm_clear_g_free((gpointer *) &config->iface); + nm_clear_g_free((gpointer *) &config->iface_type_log); nm_clear_g_free((gpointer *) &config->uuid); nm_clear_g_free((gpointer *) &config->anycast_address); nm_clear_g_free((gpointer *) &config->hostname); diff --git a/src/core/dhcp/nm-dhcp-client.h b/src/core/dhcp/nm-dhcp-client.h index f21dc9133a..903ea6acc2 100644 --- a/src/core/dhcp/nm-dhcp-client.h +++ b/src/core/dhcp/nm-dhcp-client.h @@ -103,6 +103,10 @@ typedef struct { const char *iface; + /* Interface type for logging; only set for some devices whose names can be + * ambiguous. */ + const char *iface_type_log; + /* The hardware address */ GBytes *hwaddr; @@ -264,6 +268,7 @@ gboolean nm_dhcp_client_server_id_is_rejected(NMDhcpClient *self, gconstpointer int nm_dhcp_client_get_addr_family(NMDhcpClient *self); const char *nm_dhcp_client_get_iface(NMDhcpClient *self); +const char *nm_dhcp_client_get_iface_type_for_log(NMDhcpClient *self); NMDedupMultiIndex *nm_dhcp_client_get_multi_idx(NMDhcpClient *self); int nm_dhcp_client_get_ifindex(NMDhcpClient *self);