Skip to content

Commit

Permalink
node/manager: Remove ipset config from previous node state
Browse files Browse the repository at this point in the history
Found by code inspection from
cilium#23208 (comment),
thanks to Joe.

Fix this discrepancy so that we can potentially backport this fix if
needed to older branches. The surrounding logic will get refactored in
the aforementioned PR.

This affects users that are running with the following:
  - --tunnel=disabled (native routing)
  - --enable-bpf-masquerade=false
  - --enable-ipv{4,6}-masquerade=true

Fixes: 49cb220 ("iptables: Don't masquerade traffic to cluster nodes")
Suggested-by: Joe Stringer <[email protected]>
Signed-off-by: Chris Tarazi <[email protected]>
  • Loading branch information
christarazi committed Apr 18, 2023
1 parent 8b6aa6e commit d5e5bf3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/node/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@ func (m *manager) NodeUpdated(n nodeTypes.Node) {
// Delete the old node IP addresses if they have changed in this node.
var oldNodeIPAddrs []string
for _, address := range oldNode.IPAddresses {
if option.Config.NodeIpsetNeeded() && address.Type == addressing.NodeInternalIP {
iptables.RemoveFromNodeIpset(address.IP)
}
if skipIPCache(address) {
continue
}
Expand Down

0 comments on commit d5e5bf3

Please sign in to comment.