[10/12] kdat: Config for ipv6

Submitted by Pavel Emelianov on April 24, 2017, 8:08 p.m.

Details

Message ID 58FE5B55.9040208@virtuozzo.com
State New
Series "Speed up kdat checks"
Headers show

Commit Message

Pavel Emelianov April 24, 2017, 8:08 p.m.
Whether or not kernel supports ipv6 can be found out compile-time.

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

Patch hide | download patch | download mbox

diff --git a/criu/kerndat.c b/criu/kerndat.c
index e8f955f..516fc47 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -437,6 +437,13 @@  out:
 	return exit_code;
 }
 
+#ifdef CONFIG_KERNEL_IPV6
+static inline int get_ipv6(void)
+{
+	kdat.ipv6 = CONFIG_KERNEL_IPV6;
+	return 0;
+}
+#else
 static int get_ipv6()
 {
 	if (access("/proc/sys/net/ipv6", F_OK) < 0) {
@@ -451,6 +458,7 @@  static int get_ipv6()
 	kdat.ipv6 = true;
 	return 0;
 }
+#endif
 
 int check_loginuid_op(bool full)
 {