2005-06-18 Ray Strode <rstrode@redhat.com>
* src/nm-netlink-monitor.c (nm_netlink_monitor_event_handler): check for the presence of either error condition not both. (nm_netlink_monitor_error_handler): emit error signal if error occurs. (nm_netlink_monitor_event_handler), (nm_netlink_monitor_error_handler), (nm_netlink_monitor_disconnect_handler): if an assertion fails disconnect the event handler to prevent infinite loops. * src/nm-netlink-monitor.h: add new error condition NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@719 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
18
ChangeLog
18
ChangeLog
@@ -1,3 +1,21 @@
|
|||||||
|
2005-06-18 Ray Strode <rstrode@redhat.com>
|
||||||
|
|
||||||
|
* src/nm-netlink-monitor.c
|
||||||
|
(nm_netlink_monitor_event_handler): check for the presence
|
||||||
|
of either error condition not both.
|
||||||
|
|
||||||
|
(nm_netlink_monitor_error_handler): emit error signal if
|
||||||
|
error occurs.
|
||||||
|
|
||||||
|
(nm_netlink_monitor_event_handler),
|
||||||
|
(nm_netlink_monitor_error_handler),
|
||||||
|
(nm_netlink_monitor_disconnect_handler): if an
|
||||||
|
assertion fails disconnect the event handler to prevent
|
||||||
|
infinite loops.
|
||||||
|
|
||||||
|
* src/nm-netlink-monitor.h: add new error condition
|
||||||
|
NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA
|
||||||
|
|
||||||
2005-06-18 Ray Strode <rstrode@redhat.com>
|
2005-06-18 Ray Strode <rstrode@redhat.com>
|
||||||
|
|
||||||
* src/nm-netlink-monitor.c
|
* src/nm-netlink-monitor.c
|
||||||
|
@@ -576,14 +576,14 @@ nm_netlink_monitor_event_handler (GIOChannel *channel,
|
|||||||
guint num_bytes_to_process;
|
guint num_bytes_to_process;
|
||||||
struct nlmsghdr *header;
|
struct nlmsghdr *header;
|
||||||
|
|
||||||
if (io_condition == NM_NETLINK_MONITOR_ERROR_CONDITIONS)
|
if (io_condition & NM_NETLINK_MONITOR_ERROR_CONDITIONS)
|
||||||
return nm_netlink_monitor_error_handler (channel, io_condition, monitor);
|
return nm_netlink_monitor_error_handler (channel, io_condition, monitor);
|
||||||
else if (io_condition == NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS)
|
else if (io_condition & NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS)
|
||||||
return nm_netlink_monitor_disconnect_handler (channel, io_condition, monitor);
|
return nm_netlink_monitor_disconnect_handler (channel, io_condition, monitor);
|
||||||
|
|
||||||
g_return_val_if_fail (!(io_condition &
|
g_return_val_if_fail (!(io_condition &
|
||||||
~(NM_NETLINK_MONITOR_EVENT_CONDITIONS)),
|
~(NM_NETLINK_MONITOR_EVENT_CONDITIONS)),
|
||||||
TRUE);
|
FALSE);
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
|
|
||||||
@@ -712,7 +712,7 @@ nm_netlink_monitor_event_handler (GIOChannel *channel,
|
|||||||
g_free (interface_name);
|
g_free (interface_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
g_free(received_bytes);
|
g_free (received_bytes);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@@ -722,9 +722,20 @@ nm_netlink_monitor_error_handler (GIOChannel *channel,
|
|||||||
GIOCondition io_condition,
|
GIOCondition io_condition,
|
||||||
NmNetlinkMonitor *monitor)
|
NmNetlinkMonitor *monitor)
|
||||||
{
|
{
|
||||||
|
GError *socket_error;
|
||||||
|
|
||||||
g_return_val_if_fail (!(io_condition &
|
g_return_val_if_fail (!(io_condition &
|
||||||
~(NM_NETLINK_MONITOR_ERROR_CONDITIONS)),
|
~(NM_NETLINK_MONITOR_ERROR_CONDITIONS)),
|
||||||
TRUE);
|
FALSE);
|
||||||
|
|
||||||
|
socket_error =
|
||||||
|
g_error_new (NM_NETLINK_MONITOR_ERROR,
|
||||||
|
NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA,
|
||||||
|
_("error occured while waiting for data on socket"));
|
||||||
|
|
||||||
|
g_signal_emit (G_OBJECT (monitor),
|
||||||
|
nm_netlink_monitor_signals[ERROR],
|
||||||
|
0, socket_error);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -736,6 +747,6 @@ nm_netlink_monitor_disconnect_handler (GIOChannel *channel,
|
|||||||
|
|
||||||
g_return_val_if_fail (!(io_condition &
|
g_return_val_if_fail (!(io_condition &
|
||||||
~(NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS)),
|
~(NM_NETLINK_MONITOR_DISCONNECT_CONDITIONS)),
|
||||||
TRUE);
|
FALSE);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@@ -68,6 +68,7 @@ enum _NmNetlinkMonitorError
|
|||||||
NM_NETLINK_MONITOR_ERROR_BINDING_TO_SOCKET,
|
NM_NETLINK_MONITOR_ERROR_BINDING_TO_SOCKET,
|
||||||
NM_NETLINK_MONITOR_ERROR_BAD_SENDER,
|
NM_NETLINK_MONITOR_ERROR_BAD_SENDER,
|
||||||
NM_NETLINK_MONITOR_ERROR_BAD_SOCKET_DATA,
|
NM_NETLINK_MONITOR_ERROR_BAD_SOCKET_DATA,
|
||||||
|
NM_NETLINK_MONITOR_ERROR_WAITING_FOR_SOCKET_DATA,
|
||||||
NM_NETLINK_MONITOR_ERROR_READING_FROM_SOCKET,
|
NM_NETLINK_MONITOR_ERROR_READING_FROM_SOCKET,
|
||||||
NM_NETLINK_MONITOR_ERROR_SENDING_TO_SOCKET
|
NM_NETLINK_MONITOR_ERROR_SENDING_TO_SOCKET
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user