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 23:10:14 +0200
commite3626da307d66c34e4ce12c7c38cdb8fa5da9889 (patch)
tree5288c5d59deabccee725b974caeae4643b26a254 /python/vyos/util.py
parentadda3d86080bb3b8fe26424c7d829e40eb9e2b23 (diff)
downloadvyos-1x-e3626da307d66c34e4ce12c7c38cdb8fa5da9889.tar.gz
vyos-1x-e3626da307d66c34e4ce12c7c38cdb8fa5da9889.zip
vyos.util: T4319: add is_ipv6_enabled() helper function
(cherry picked from commit df0fbfeedce0f163e9d10be21d58ad4dc797a28a)
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 b5d81fba5..4283e604c 100644
--- a/python/vyos/util.py
+++ b/python/vyos/util.py
@@ -827,3 +827,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')