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
0914272a
Unverified
Commit
0914272a
authored
Dec 10, 2018
by
Kubernetes Prow Robot
Committed by
GitHub
Dec 10, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #71035 from Nordix/issue-68437
Fixes NodePort in ipv6 with proxy-mode=ipvs
parents
486f407b
2e5a985e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
7 deletions
+12
-7
netlink_linux.go
pkg/proxy/ipvs/netlink_linux.go
+8
-3
netlink_unsupported.go
pkg/proxy/ipvs/netlink_unsupported.go
+1
-1
proxier.go
pkg/proxy/ipvs/proxier.go
+3
-3
No files found.
pkg/proxy/ipvs/netlink_linux.go
View file @
0914272a
...
@@ -30,11 +30,12 @@ import (
...
@@ -30,11 +30,12 @@ import (
type
netlinkHandle
struct
{
type
netlinkHandle
struct
{
netlink
.
Handle
netlink
.
Handle
isIPv6
bool
}
}
// NewNetLinkHandle will crate a new NetLinkHandle
// NewNetLinkHandle will crate a new NetLinkHandle
func
NewNetLinkHandle
()
NetLinkHandle
{
func
NewNetLinkHandle
(
isIPv6
bool
)
NetLinkHandle
{
return
&
netlinkHandle
{
netlink
.
Handle
{}}
return
&
netlinkHandle
{
netlink
.
Handle
{}
,
isIPv6
}
}
}
// EnsureAddressBind checks if address is bound to the interface and, if not, binds it. If the address is already bound, return true.
// EnsureAddressBind checks if address is bound to the interface and, if not, binds it. If the address is already bound, return true.
...
@@ -181,7 +182,11 @@ func (h *netlinkHandle) GetLocalAddresses(dev, filterDev string) (sets.String, e
...
@@ -181,7 +182,11 @@ func (h *netlinkHandle) GetLocalAddresses(dev, filterDev string) (sets.String, e
if
route
.
LinkIndex
==
filterLinkIndex
{
if
route
.
LinkIndex
==
filterLinkIndex
{
continue
continue
}
}
if
route
.
Src
!=
nil
{
if
h
.
isIPv6
{
if
route
.
Dst
.
IP
.
To4
()
==
nil
&&
!
route
.
Dst
.
IP
.
IsLinkLocalUnicast
()
{
res
.
Insert
(
route
.
Dst
.
IP
.
String
())
}
}
else
if
route
.
Src
!=
nil
{
res
.
Insert
(
route
.
Src
.
String
())
res
.
Insert
(
route
.
Src
.
String
())
}
}
}
}
...
...
pkg/proxy/ipvs/netlink_unsupported.go
View file @
0914272a
...
@@ -28,7 +28,7 @@ type emptyHandle struct {
...
@@ -28,7 +28,7 @@ type emptyHandle struct {
}
}
// NewNetLinkHandle will create an EmptyHandle
// NewNetLinkHandle will create an EmptyHandle
func
NewNetLinkHandle
()
NetLinkHandle
{
func
NewNetLinkHandle
(
ipv6
bool
)
NetLinkHandle
{
return
&
emptyHandle
{}
return
&
emptyHandle
{}
}
}
...
...
pkg/proxy/ipvs/proxier.go
View file @
0914272a
...
@@ -406,14 +406,14 @@ func NewProxier(ipt utiliptables.Interface,
...
@@ -406,14 +406,14 @@ func NewProxier(ipt utiliptables.Interface,
healthzServer
:
healthzServer
,
healthzServer
:
healthzServer
,
ipvs
:
ipvs
,
ipvs
:
ipvs
,
ipvsScheduler
:
scheduler
,
ipvsScheduler
:
scheduler
,
ipGetter
:
&
realIPGetter
{
nl
:
NewNetLinkHandle
()},
ipGetter
:
&
realIPGetter
{
nl
:
NewNetLinkHandle
(
isIPv6
)},
iptablesData
:
bytes
.
NewBuffer
(
nil
),
iptablesData
:
bytes
.
NewBuffer
(
nil
),
filterChainsData
:
bytes
.
NewBuffer
(
nil
),
filterChainsData
:
bytes
.
NewBuffer
(
nil
),
natChains
:
bytes
.
NewBuffer
(
nil
),
natChains
:
bytes
.
NewBuffer
(
nil
),
natRules
:
bytes
.
NewBuffer
(
nil
),
natRules
:
bytes
.
NewBuffer
(
nil
),
filterChains
:
bytes
.
NewBuffer
(
nil
),
filterChains
:
bytes
.
NewBuffer
(
nil
),
filterRules
:
bytes
.
NewBuffer
(
nil
),
filterRules
:
bytes
.
NewBuffer
(
nil
),
netlinkHandle
:
NewNetLinkHandle
(),
netlinkHandle
:
NewNetLinkHandle
(
isIPv6
),
ipset
:
ipset
,
ipset
:
ipset
,
nodePortAddresses
:
nodePortAddresses
,
nodePortAddresses
:
nodePortAddresses
,
networkInterfacer
:
utilproxy
.
RealNetwork
{},
networkInterfacer
:
utilproxy
.
RealNetwork
{},
...
@@ -600,7 +600,7 @@ func CleanupLeftovers(ipvs utilipvs.Interface, ipt utiliptables.Interface, ipset
...
@@ -600,7 +600,7 @@ func CleanupLeftovers(ipvs utilipvs.Interface, ipt utiliptables.Interface, ipset
}
}
}
}
// Delete dummy interface created by ipvs Proxier.
// Delete dummy interface created by ipvs Proxier.
nl
:=
NewNetLinkHandle
()
nl
:=
NewNetLinkHandle
(
false
)
err
:=
nl
.
DeleteDummyDevice
(
DefaultDummyDevice
)
err
:=
nl
.
DeleteDummyDevice
(
DefaultDummyDevice
)
if
err
!=
nil
{
if
err
!=
nil
{
klog
.
Errorf
(
"Error deleting dummy device %s created by IPVS proxier: %v"
,
DefaultDummyDevice
,
err
)
klog
.
Errorf
(
"Error deleting dummy device %s created by IPVS proxier: %v"
,
DefaultDummyDevice
,
err
)
...
...
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