mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 01:30:16 +01:00
monitor: Use nl_socket_alloc() instead of nl_socket_alloc_cb()
We are using the default cb set anyways. This allows running NM with the NLCB=debug environment variable set to get some debug messages out of libnl related to netlink communication. NLCB=debug won't print received netlink messages as the MSG_IN handler is in use by NM to verify message origins. It's probably best to introduce new handlers in libnl for debugging purpose so both use of MSG_IN and enable debugging is possible.
This commit is contained in:
parent
d6864d7cf5
commit
271fce0267
1 changed files with 2 additions and 8 deletions
|
|
@ -282,15 +282,12 @@ event_connection_setup (NMNetlinkMonitor *self, GError **error)
|
|||
NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self);
|
||||
GError *channel_error = NULL;
|
||||
GIOFlags channel_flags;
|
||||
struct nl_cb *cb;
|
||||
int fd;
|
||||
|
||||
g_return_val_if_fail (priv->io_channel == NULL, FALSE);
|
||||
|
||||
/* Set up the event listener connection */
|
||||
cb = nl_cb_alloc (NL_CB_DEFAULT);
|
||||
priv->nlh_event = nl_socket_alloc_cb (cb);
|
||||
nl_cb_put (cb);
|
||||
priv->nlh_event = nl_socket_alloc ();
|
||||
if (!priv->nlh_event) {
|
||||
g_set_error (error, NM_NETLINK_MONITOR_ERROR,
|
||||
NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_HANDLE,
|
||||
|
|
@ -344,16 +341,13 @@ static gboolean
|
|||
sync_connection_setup (NMNetlinkMonitor *self, GError **error)
|
||||
{
|
||||
NMNetlinkMonitorPrivate *priv = NM_NETLINK_MONITOR_GET_PRIVATE (self);
|
||||
struct nl_cb *cb;
|
||||
#ifdef LIBNL_NEEDS_ADDR_CACHING_WORKAROUND
|
||||
struct nl_cache *addr_cache;
|
||||
#endif
|
||||
int err;
|
||||
|
||||
/* Set up the event listener connection */
|
||||
cb = nl_cb_alloc (NL_CB_DEFAULT);
|
||||
priv->nlh_sync = nl_socket_alloc_cb (cb);
|
||||
nl_cb_put (cb);
|
||||
priv->nlh_sync = nl_socket_alloc ();
|
||||
if (!priv->nlh_sync) {
|
||||
g_set_error (error, NM_NETLINK_MONITOR_ERROR,
|
||||
NM_NETLINK_MONITOR_ERROR_NETLINK_ALLOC_HANDLE,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue