mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-10-04 22:41:03 +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 {
|
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 {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user