From f1c2ace2631fa691b81a181bbbf2a3b29b0e69f6 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Tue, 23 Oct 2018 18:24:31 +0200 Subject: src: move socket open and reopen to mnl.c These functions are part of the mnl backend, move them there. Remove netlink_close_sock(), use direct call to mnl_socket_close(). Signed-off-by: Pablo Neira Ayuso --- src/netlink.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'src/netlink.c') diff --git a/src/netlink.c b/src/netlink.c index 403780ff..8eb2ccad 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -10,7 +10,6 @@ */ #include -#include #include #include #include @@ -53,32 +52,6 @@ const struct location netlink_location = { .indesc = &indesc_netlink, }; -struct mnl_socket *netlink_open_sock(void) -{ - struct mnl_socket *nf_sock; - - nf_sock = mnl_socket_open(NETLINK_NETFILTER); - if (nf_sock == NULL) - netlink_init_error(); - - if (fcntl(mnl_socket_get_fd(nf_sock), F_SETFL, O_NONBLOCK)) - netlink_init_error(); - - return nf_sock; -} - -void netlink_close_sock(struct mnl_socket *nf_sock) -{ - if (nf_sock) - mnl_socket_close(nf_sock); -} - -struct mnl_socket *netlink_restart(struct mnl_socket *nf_sock) -{ - netlink_close_sock(nf_sock); - return netlink_open_sock(); -} - void __noreturn __netlink_abi_error(const char *file, int line, const char *reason) { -- cgit v1.2.3