Skip to content

Commit

Permalink
Merge pull request #234 from mars1024/bugfix/enhanced-addr
Browse files Browse the repository at this point in the history
[CHERRY-PICK] add flag to disable enhanced address
  • Loading branch information
hhyasdf authored Apr 25, 2022
2 parents 0beeab2 + 80528e6 commit 91dbf6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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

0 comments on commit 91dbf6f

Please sign in to comment.