Skip to contentSkip to conversation

libmnl [PATCH 8/8] examples: use mnl_socket_setsockopt

PATCH Ken-ichirou MATSUZAWA 1 participant 1 message Dec 7, 2013 netfilter

lore
Share & tools
lore
#0 lore raw

instead of raw setsockopt()

---
 examples/netfilter/nfct-daemon.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
examples/netfilter/nfct-daemon.c +2 -4
index a9b93db..a4ef0af 100644
@@ -293,10 +293,8 @@ int main(int argc, char *argv[])
 	 * b) if the user-space process does not pull messages from the
 	 *    receiver buffer so often.
 	 */
-	setsockopt(mnl_socket_get_fd(nl), SOL_NETLINK,
-		   NETLINK_BROADCAST_ERROR, &on, sizeof(int));
-	setsockopt(mnl_socket_get_fd(nl), SOL_NETLINK, NETLINK_NO_ENOBUFS,
-		   &on, sizeof(int));
+	mnl_socket_setsockopt(nl, NETLINK_BROADCAST_ERROR, &on, sizeof(int));
+	mnl_socket_setsockopt(nl, NETLINK_NO_ENOBUFS, &on, sizeof(int));
 
 	nlh = mnl_nlmsg_put_header(buf);
 	/* Counters are atomically zeroed in each dump */
Signature · 1 line
1.8.4.rc3