From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: phil@nwl.cc, eric@regit.org
Subject: [PATCH nft 2/3] netlink: remove nfsock_open()
Date: Fri, 1 Sep 2017 12:14:06 +0200 [thread overview]
Message-ID: <1504260847-5408-2-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1504260847-5408-1-git-send-email-pablo@netfilter.org>
Just merge this code to netlink_open_sock().
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
src/netlink.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/netlink.c b/src/netlink.c
index 90f8486581fe..b6336e836e88 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;
}
--
2.1.4
next prev parent reply other threads:[~2017-09-01 10:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-01 10:14 [PATCH nft 1/3] src: move nf_sock into nft_ctx structure Pablo Neira Ayuso
2017-09-01 10:14 ` Pablo Neira Ayuso [this message]
2017-09-01 10:14 ` [PATCH nft 3/3] src: add nft_ctx_netlink_init() Pablo Neira Ayuso
2017-09-01 10:17 ` Pablo Neira Ayuso
2017-09-01 10:50 ` Phil Sutter
2017-09-01 10:58 ` Pablo Neira Ayuso
2017-09-01 11:20 ` Phil Sutter
2017-09-01 12:28 ` Florian Westphal
2017-09-01 17:50 ` [PATCH nft 1/3] src: move nf_sock into nft_ctx structure Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504260847-5408-2-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=eric@regit.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).