[CRIU] [PATCH 2/5] sockets: skip errors from collecting of netlink and packet sockets

Andrey Vagin avagin at openvz.org
Wed Mar 27 09:23:14 EDT 2013


The packet diag are not compiled in Fedora 19 kernel.
The netlink diag is going to be merged in 3.10.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 sockets.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/sockets.c b/sockets.c
index 2568367..83bc7f3 100644
--- a/sockets.c
+++ b/sockets.c
@@ -515,15 +515,23 @@ int collect_sockets(int pid)
 	req.r.p.pdiag_show	= PACKET_SHOW_INFO | PACKET_SHOW_MCLIST |
 					PACKET_SHOW_FANOUT | PACKET_SHOW_RING_CFG;
 	tmp = do_rtnl_req(nl, &req, sizeof(req), packet_receive_one, NULL);
-	if (tmp)
-		err = tmp;
+	if (tmp) {
+		if (tmp == -ENOENT) /* Fedora 19 */
+			pr_warn("The currect kernel doesn't support packet_diag\n");
+		else
+			err = tmp;
+	}
 
 	req.r.n.sdiag_family	= AF_NETLINK;
 	req.r.n.sdiag_protocol	= NDIAG_PROTO_ALL;
 	req.r.n.ndiag_show	= NDIAG_SHOW_GROUPS;
 	tmp = do_rtnl_req(nl, &req, sizeof(req), netlink_receive_one, NULL);
-	if (tmp)
-		err = tmp;
+	if (tmp) {
+		if (tmp == -ENOENT) /* Going to be in 3.10 */
+			pr_warn("The currect kernel doesn't support netlink_diag\n");
+		else
+			err = tmp;
+	}
 
 	close(nl);
 out:
-- 
1.7.11.7



More information about the CRIU mailing list