Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
abdf0c73
Commit
abdf0c73
authored
Aug 03, 2022
by
Roberto Bonafiglia
Committed by
Roberto Bonafiglia
Aug 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix comments and add check in case of IPv6 only node
Signed-off-by:
Roberto Bonafiglia
<
roberto.bonafiglia@suse.com
>
parent
d90ba303
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
iface.go
pkg/netutil/iface.go
+1
-1
net.go
pkg/util/net.go
+6
-3
No files found.
pkg/netutil/iface.go
View file @
abdf0c73
...
...
@@ -38,7 +38,7 @@ func getIPFromInterface(ifaceName string) (string, error) {
if
err
!=
nil
{
return
""
,
errors
.
Wrapf
(
err
,
"unable to parse CIDR for interface %s"
,
iface
.
Name
)
}
//
skipping if not ipv4
//
if not IPv4 adding it on IPv6 list
if
ip
.
To4
()
==
nil
{
if
ip
.
IsGlobalUnicast
()
{
globalUnicastsIPv6
=
append
(
globalUnicastsIPv6
,
ip
.
String
())
...
...
pkg/util/net.go
View file @
abdf0c73
...
...
@@ -142,9 +142,12 @@ func GetHostnameAndIPs(name string, nodeIPs cli.StringSlice) (string, []net.IP,
return
""
,
nil
,
err
}
ips
=
append
(
ips
,
hostIP
)
hostIPv6
,
err
:=
apinet
.
ResolveBindAddress
(
net
.
IPv6loopback
)
if
err
==
nil
&&
!
hostIPv6
.
Equal
(
hostIP
)
{
ips
=
append
(
ips
,
hostIPv6
)
// If IPv6 it's an IPv6 only node
if
hostIP
.
To4
()
!=
nil
{
hostIPv6
,
err
:=
apinet
.
ResolveBindAddress
(
net
.
IPv6loopback
)
if
err
==
nil
&&
!
hostIPv6
.
Equal
(
hostIP
)
{
ips
=
append
(
ips
,
hostIPv6
)
}
}
}
else
{
var
err
error
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment