mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-10-04 06:21:09 +02:00
Improved detect in ipv6IsEnabled() (#555)
* Improved detect in ipv6IsEnabled() * Added comments in ipv6IsEnabled. Problem described in #155
This commit is contained in:
parent
827bbbcd4d
commit
f95cdedfaa
@ -83,7 +83,14 @@ func ipv4IsEnabled() bool {
|
||||
}
|
||||
|
||||
func ipv6IsEnabled() bool {
|
||||
l, err := net.Listen("tcp6", "")
|
||||
// If ipv6 is disabled with;
|
||||
//
|
||||
// sysctl -w net.ipv6.conf.all.disable_ipv6=1
|
||||
//
|
||||
// It is still possible to listen on the any-address "::". So this
|
||||
// function tries the loopback address "::1" which must be present
|
||||
// if ipv6 is enabled.
|
||||
l, err := net.Listen("tcp6", "[::1]:0")
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user