platform: log information about (sync) genetlink socket

This commit is contained in:
Thomas Haller
2022-06-17 08:44:35 +02:00
parent c7fea44e47
commit 2d211cfd5c

View File

@@ -9712,20 +9712,26 @@ constructed(GObject *_object)
nm_platform_get_use_udev(platform) ? "use" : "no", nm_platform_get_use_udev(platform) ? "use" : "no",
nm_platform_get_cache_tc(platform) ? "use" : "no"); nm_platform_get_cache_tc(platform) ? "use" : "no");
/*************************************************************************/
nle = nl_socket_new(&priv->sk_genl_sync, NETLINK_GENERIC); nle = nl_socket_new(&priv->sk_genl_sync, NETLINK_GENERIC);
g_assert(!nle); g_assert(!nle);
_LOGD("genl: generic netlink socket for sync operations created: port=%u, fd=%d",
nl_socket_get_local_port(priv->sk_genl_sync),
nl_socket_get_fd(priv->sk_genl_sync));
/*************************************************************************/
nle = nl_socket_new(&priv->sk_rtnl, NETLINK_ROUTE); nle = nl_socket_new(&priv->sk_rtnl, NETLINK_ROUTE);
g_assert(!nle); g_assert(!nle);
nle = nl_socket_set_passcred(priv->sk_rtnl, 1); nle = nl_socket_set_passcred(priv->sk_rtnl, 1);
g_assert(!nle); g_assert(!nle);
/* No blocking for event socket, so that we can drain it safely. */
nle = nl_socket_set_nonblocking(priv->sk_rtnl); nle = nl_socket_set_nonblocking(priv->sk_rtnl);
g_assert(!nle); g_assert(!nle);
/* use 8 MB for receive socket kernel queue. */
nle = nl_socket_set_buffer_size(priv->sk_rtnl, 8 * 1024 * 1024, 0); nle = nl_socket_set_buffer_size(priv->sk_rtnl, 8 * 1024 * 1024, 0);
g_assert(!nle); g_assert(!nle);
@@ -9753,7 +9759,7 @@ constructed(GObject *_object)
fd = nl_socket_get_fd(priv->sk_rtnl); fd = nl_socket_get_fd(priv->sk_rtnl);
_LOGD("Netlink socket for events established: port=%u, fd=%d", _LOGD("rtnl: rtnetlink socket created: port=%u, fd=%d",
nl_socket_get_local_port(priv->sk_rtnl), nl_socket_get_local_port(priv->sk_rtnl),
fd); fd);
@@ -9763,6 +9769,8 @@ constructed(GObject *_object)
rtnl_event_handler, rtnl_event_handler,
platform); platform);
/*************************************************************************/
/* complete construction of the GObject instance before populating the cache. */ /* complete construction of the GObject instance before populating the cache. */
G_OBJECT_CLASS(nm_linux_platform_parent_class)->constructed(_object); G_OBJECT_CLASS(nm_linux_platform_parent_class)->constructed(_object);