summaryrefslogtreecommitdiff
path: root/python/vyos/util.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-03-30 19:18:09 +0200
committerChristian Poessinger <christian@poessinger.com>2022-03-30 19:18:53 +0200
commitdf0fbfeedce0f163e9d10be21d58ad4dc797a28a (patch)
treedff16ecf9f1cebf3bd1a1525c30c27d3c0a1a375 /python/vyos/util.py
parentbafb1973d906707cb571385e994a949d0d90b645 (diff)
downloadvyos-1x-df0fbfeedce0f163e9d10be21d58ad4dc797a28a.tar.gz
vyos-1x-df0fbfeedce0f163e9d10be21d58ad4dc797a28a.zip
vyos.util: T4319: add is_ipv6_enabled() helper function
Diffstat (limited to 'python/vyos/util.py')
-rw-r--r--python/vyos/util.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/vyos/util.py b/python/vyos/util.py
index f46775490..f3f323c34 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -1019,3 +1019,7 @@ def sysctl_write(name, value):
call(f'sysctl -wq {name}={value}')
return True
return False
+
+def is_ipv6_enabled() -> bool:
+ """ Check if IPv6 support on the system is enabled or not """
+ return (sysctl_read('net.ipv6.conf.all.disable_ipv6') == '0')