From 42f730847face3dcca4423cc565abc3ea47b9f35 Mon Sep 17 00:00:00 2001 From: Robert Volkmann Date: Tue, 23 Jan 2024 15:39:00 +0100 Subject: [PATCH] Switch to symmetric IRB --- cmd/internal/switcher/sonic/db/configdb.go | 4 ++-- cmd/internal/switcher/sonic/redis/applier.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/internal/switcher/sonic/db/configdb.go b/cmd/internal/switcher/sonic/db/configdb.go index db4574d4..88953e78 100644 --- a/cmd/internal/switcher/sonic/db/configdb.go +++ b/cmd/internal/switcher/sonic/db/configdb.go @@ -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 { diff --git a/cmd/internal/switcher/sonic/redis/applier.go b/cmd/internal/switcher/sonic/redis/applier.go index 685f69b3..b4a340bc 100644 --- a/cmd/internal/switcher/sonic/redis/applier.go +++ b/cmd/internal/switcher/sonic/redis/applier.go @@ -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) } }