Skip to content

Commit

Permalink
fix memory overflow, add mac_binding related options to router (#4610)
Browse files Browse the repository at this point in the history
Signed-off-by: clyi <[email protected]>
  • Loading branch information
changluyi authored Oct 15, 2024
1 parent 2c84c60 commit 4e7fb34
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/controller/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ func (c *Controller) initClusterRouter() error {
klog.Infof("exists routers: %v", lrs)
for _, r := range lrs {
if c.config.ClusterRouter == r {
options := map[string]string{
"always_learn_from_arp_request": "false",
"dynamic_neigh_routers": "true",
}
err := c.ovnLegacyClient.UpdateLogicalRouter(r, options)
if err != nil {
klog.Errorf("failed to update router %s: %v", r, err)
return err
}
return nil
}
}
Expand Down
9 changes: 9 additions & 0 deletions pkg/controller/vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,15 @@ func (c *Controller) createVpcRouter(lr string) error {
klog.Infof("exists routers %v", lrs)
for _, r := range lrs {
if lr == r {
options := map[string]string{
"always_learn_from_arp_request": "false",
"dynamic_neigh_routers": "true",
}
err := c.ovnLegacyClient.UpdateLogicalRouter(lr, options)
if err != nil {
klog.Errorf("failed to update router %s: %v", lr, err)
return err
}
return nil
}
}
Expand Down
10 changes: 10 additions & 0 deletions pkg/ovs/ovn-nbctl-legacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,16 @@ func (c LegacyClient) CreateLogicalRouter(lr string) error {
return err
}

// UpdateLogicalRouter update logical router in ovn
func (c LegacyClient) UpdateLogicalRouter(lr string, options map[string]string) error {
args := []string{"set", "Logical_Router", lr}
for key, value := range options {
args = append(args, fmt.Sprintf("options:%s=%s", key, value))
}
_, err := c.ovnNbCommand(args...)
return err
}

// DeleteLogicalRouter create logical router in ovn
func (c LegacyClient) DeleteLogicalRouter(lr string) error {
_, err := c.ovnNbCommand(IfExists, "lr-del", lr)
Expand Down

0 comments on commit 4e7fb34

Please sign in to comment.