Skip to content

Commit

Permalink
Switch to symmetric IRB
Browse files Browse the repository at this point in the history
  • Loading branch information
robertvolkmann committed Jan 23, 2024
1 parent 63ed9d4 commit 42f7308
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/internal/switcher/sonic/db/configdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ func (d *ConfigDB) ExistVrf(ctx context.Context, vrf string) (bool, error) {
return d.c.Exists(ctx, key)
}

func (d *ConfigDB) CreateVrf(ctx context.Context, vrf string) error {
func (d *ConfigDB) CreateVrf(ctx context.Context, vrf string, vni uint32) error {
key := Key{"VRF", vrf}

return d.c.HSet(ctx, key, Val{"fallback": "false"})
return d.c.HSet(ctx, key, Val{"fallback": "false", "vni": fmt.Sprintf("%d", vni)})
}

func (d *ConfigDB) SetVrfMember(ctx context.Context, interfaceName string, vrf string) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/switcher/sonic/redis/applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (a *Applier) configureVrf(vrfName string, vrf *types.Vrf) error {
return err
}
if !exist {
if err := a.db.Config.CreateVrf(ctx, vrfName); err != nil {
if err := a.db.Config.CreateVrf(ctx, vrfName, vrf.VNI); err != nil {
return fmt.Errorf("could not create vrf %s: %w", vrfName, err)
}
}
Expand Down

0 comments on commit 42f7308

Please sign in to comment.