Agrego el cierre del socket de eventos del netlink.

master
Félix Arreola Rodríguez 2020-01-02 12:54:37 -06:00
parent 4380abdeb7
commit d2cea315d1
3 changed files with 16 additions and 0 deletions

View File

@ -131,5 +131,8 @@ int main (int argc, char *argv[]) {
g_main_loop_run (loop);
/* Detener la llegada de eventos */
netlink_events_clear (&handle);
return 0;
}

View File

@ -85,3 +85,15 @@ void netlink_events_setup (NetworkInadorHandle *handle) {
handle->nl_sock_route_events = sock_req;
}
void netlink_events_clear (NetworkInadorHandle *handle) {
/* Primero, detener los eventos del source watch */
g_source_remove (handle->route_events_source);
handle->route_events_source = 0;
/* Cerrar el socket */
nl_close (handle->nl_sock_route_events);
handle->nl_sock_route_events = NULL;
}

View File

@ -26,5 +26,6 @@
#include "common.h"
void netlink_events_setup (NetworkInadorHandle *handle);
void netlink_events_clear (NetworkInadorHandle *handle);
#endif