From 5e22cfb19a60f09d7e9825f6e68ac7036769aa56 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 1 Sep 2017 11:56:18 +0200 Subject: netlink: remove nfsock_open() Just merge this code to netlink_open_sock(). Signed-off-by: Pablo Neira Ayuso --- src/netlink.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/netlink.c b/src/netlink.c index 90f84865..b6336e83 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -48,22 +48,16 @@ const struct location netlink_location = { .indesc = &indesc_netlink, }; -static struct mnl_socket *nfsock_open(void) -{ - struct mnl_socket *s; - - s = mnl_socket_open(NETLINK_NETFILTER); - if (s == NULL) - netlink_init_error(); - return s; -} - struct mnl_socket *netlink_open_sock(void) { struct mnl_socket *nf_sock; - nf_sock = nfsock_open(); + nf_sock = mnl_socket_open(NETLINK_NETFILTER); + if (nf_sock == NULL) + netlink_init_error(); + fcntl(mnl_socket_get_fd(nf_sock), F_SETFL, O_NONBLOCK); + return nf_sock; } -- cgit v1.2.3