Skip to content

Commit

Permalink
daemon: Do not remove PERM L2 entries in L4LB
Browse files Browse the repository at this point in the history
In the L4LB mode, the PERM L2 entries are managed by users. So, in this
mode Cilium should not mess with them.

Signed-off-by: Martynas Pumputis <m@lambda.lt>
  • Loading branch information
brb authored and borkmann committed Dec 12, 2022
1 parent 673b1e0 commit ced77b3
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions daemon/cmd/daemon_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1858,16 +1858,18 @@ func runDaemon(d *Daemon, restoredEndpoints *endpointRestoreState, cleaner *daem
log.WithError(err).Warn("Failed to send agent start monitor message")
}

if !d.datapath.Node().NodeNeighDiscoveryEnabled() {
// Remove all non-GC'ed neighbor entries that might have previously set
// by a Cilium instance.
d.datapath.Node().NodeCleanNeighbors(false)
} else {
// If we came from an agent upgrade, migrate entries.
d.datapath.Node().NodeCleanNeighbors(true)
// Start periodical refresh of the neighbor table from the agent if needed.
if option.Config.ARPPingRefreshPeriod != 0 && !option.Config.ARPPingKernelManaged {
d.nodeDiscovery.Manager.StartNeighborRefresh(d.datapath.Node())
if option.Config.DatapathMode != datapathOption.DatapathModeLBOnly {
if !d.datapath.Node().NodeNeighDiscoveryEnabled() {
// Remove all non-GC'ed neighbor entries that might have previously set
// by a Cilium instance.
d.datapath.Node().NodeCleanNeighbors(false)
} else {
// If we came from an agent upgrade, migrate entries.
d.datapath.Node().NodeCleanNeighbors(true)
// Start periodical refresh of the neighbor table from the agent if needed.
if option.Config.ARPPingRefreshPeriod != 0 && !option.Config.ARPPingKernelManaged {
d.nodeDiscovery.Manager.StartNeighborRefresh(d.datapath.Node())
}
}
}

Expand Down

0 comments on commit ced77b3

Please sign in to comment.