Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHERRY-PICK] add flag to disable enhanced address #234

Merged
merged 1 commit into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkg/daemon/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ type Configuration struct {
NeighGCThresh1 int
NeighGCThresh2 int
NeighGCThresh3 int

EnableVlanArpEnhancement bool
}

// ParseFlags will parse cmd args then init kubeClient and configuration
Expand All @@ -117,6 +119,7 @@ func ParseFlags() (*Configuration, error) {
argNeighGCThresh2 = pflag.Int("neigh-gc-thresh2", DefaultNeighGCThresh2, "Value to set net.ipv4/ipv6.neigh.default.gc_thresh2")
argNeighGCThresh3 = pflag.Int("neigh-gc-thresh3", DefaultNeighGCThresh3, "Value to set net.ipv4/ipv6.neigh.default.gc_thresh3")
argExtraNodeLocalVxlanIPCidrs = pflag.String("extra-node-local-vxlan-ip-cidrs", "", "Cidrs to select node extra local vxlan ip, e.g., \"192.168.10.0/24,10.2.3.0/24\"")
argEnableVlanArpEnhancement = pflag.Bool("enable-vlan-arp-enhancement", false, "Whether enable arp source enhancement in a vlan environment")
)

// mute info log for ipset lib
Expand Down Expand Up @@ -163,6 +166,7 @@ func ParseFlags() (*Configuration, error) {
NeighGCThresh2: *argNeighGCThresh2,
NeighGCThresh3: *argNeighGCThresh3,
VxlanExpiredNeighCachesClearInterval: *argVxlanExpiredNeighCachesClearInterval,
EnableVlanArpEnhancement: *argEnableVlanArpEnhancement,
}

if *argPreferVlanInterfaces == "" {
Expand Down
6 changes: 4 additions & 2 deletions pkg/daemon/controller/ipinstance.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,10 @@ func (c *Controller) reconcileIPInfo() error {
}
}

if err := c.addrV4Manager.SyncAddresses(c.getIPInstanceByAddress); err != nil {
return fmt.Errorf("sync ipv4 addresses failed: %v", err)
if c.config.EnableVlanArpEnhancement {
if err := c.addrV4Manager.SyncAddresses(c.getIPInstanceByAddress); err != nil {
return fmt.Errorf("sync ipv4 addresses failed: %v", err)
}
}

return nil
Expand Down