Blame SOURCES/0011-netlink-Complain-if-setting-O_NONBLOCK-fails.patch

a05102
From 094f7dd2dce0c449313f1f1ea69dc849fc89b62a Mon Sep 17 00:00:00 2001
a05102
From: Phil Sutter <psutter@redhat.com>
a05102
Date: Wed, 20 Jun 2018 09:22:47 +0200
a05102
Subject: [PATCH] netlink: Complain if setting O_NONBLOCK fails
a05102
a05102
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1504157
a05102
Upstream Status: nftables commit 4342fcbd40534
a05102
a05102
commit 4342fcbd40534158107ebe6a10e5f7886b3e8ced
a05102
Author: Phil Sutter <phil@nwl.cc>
a05102
Date:   Thu Mar 1 15:00:31 2018 +0100
a05102
a05102
    netlink: Complain if setting O_NONBLOCK fails
a05102
a05102
    Assuming that code is not aware that reads from netlink socket may
a05102
    block, treat inability to set O_NONBLOCK flag as fatal initialization
a05102
    error aborting program execution.
a05102
a05102
    Signed-off-by: Phil Sutter <phil@nwl.cc>
a05102
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
a05102
---
a05102
 src/netlink.c | 3 ++-
a05102
 1 file changed, 2 insertions(+), 1 deletion(-)
a05102
a05102
diff --git a/src/netlink.c b/src/netlink.c
a05102
index ca0e207..ebfad18 100644
a05102
--- a/src/netlink.c
a05102
+++ b/src/netlink.c
a05102
@@ -58,7 +58,8 @@ struct mnl_socket *netlink_open_sock(void)
a05102
 	if (nf_sock == NULL)
a05102
 		netlink_init_error();
a05102
 
a05102
-	fcntl(mnl_socket_get_fd(nf_sock), F_SETFL, O_NONBLOCK);
a05102
+	if (fcntl(mnl_socket_get_fd(nf_sock), F_SETFL, O_NONBLOCK))
a05102
+		netlink_init_error();
a05102
 
a05102
 	return nf_sock;
a05102
 }
a05102
-- 
a05102
1.8.3.1
a05102