]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
netlink: remove nfsock_open()
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 1 Sep 2017 09:56:18 +0000 (11:56 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 1 Sep 2017 10:03:21 +0000 (12:03 +0200)
Just merge this code to netlink_open_sock().

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
src/netlink.c

index 90f8486581fe1fb5a33129ce11041c9730e6cbe0..b6336e836e8873499bb00f8d651042e8afdb34da 100644 (file)
@@ -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;
 }