[CRIU] [PATCH 03/12] kdat: Config option for iptables xtlocks

Pavel Emelyanov xemul at virtuozzo.com
Mon Apr 24 13:07:17 PDT 2017


Whether or not iptables accepts the -w option can be in
distro case found out compile time. So there's no strict
need to do auto detection on each criu launch.

Default build (with empty config) produces code with
auto-detection.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/kerndat.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/criu/kerndat.c b/criu/kerndat.c
index 951b09a..b291682 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -484,6 +484,14 @@ static int kerndat_loginuid(bool for_restore)
 	return ret;
 }
 
+#ifdef CONFIG_IPTABLES_HAS_XTLOCKS
+static inline int kerndat_iptables_has_xtlocks(void)
+{
+	kdat.has_xtlocks = CONFIG_IPTABLES_HAS_XTLOCKS;
+	pr_info("Iptables xtlocks forced to %d\n", CONFIG_IPTABLES_HAS_XTLOCKS);
+	return 0;
+}
+#else
 static int kerndat_iptables_has_xtlocks(void)
 {
 	int fd;
@@ -502,6 +510,7 @@ static int kerndat_iptables_has_xtlocks(void)
 	close_safe(&fd);
 	return 0;
 }
+#endif
 
 int kerndat_tcp_half_closed(void)
 {
-- 
2.5.5



More information about the CRIU mailing list