From 78b12e8f24ba22c37a928469a2906015065b4523 Mon Sep 17 00:00:00 2001 From: Justine Jose <51496803+justinejose91@users.noreply.github.com> Date: Thu, 12 Sep 2019 19:44:44 -0700 Subject: [PATCH] Bugfix for creating 2 interface entries when IP is configured, and when interface comes up as L2. (#116) --- src/translib/intf_app.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/translib/intf_app.go b/src/translib/intf_app.go index b74e978aa0..ce686e714e 100644 --- a/src/translib/intf_app.go +++ b/src/translib/intf_app.go @@ -1248,6 +1248,17 @@ func (app *IntfApp) processCommon(d *db.DB) (SetResponse, error) { } for key, entry1 := range app.ifIPTableMap { + ifEntry, err := d.GetEntry(app.intfIPTs, db.Key{Comp: []string{key}}) + if err != nil || !ifEntry.IsPopulated() { + log.Infof("Interface Entry not present for Key:%s for IP config!", key) + m := make(map[string]string) + m["NULL"] = "NULL" + err = d.CreateEntry(app.intfIPTs, db.Key{Comp: []string{key}}, db.Value{Field: m}) + if err != nil { + return resp, err + } + log.Infof("Created Interface entry with Interface name : %s alone!", key) + } for ip, entry := range entry1 { if entry.op == opCreate { log.Info("Creating entry for ", key, ":", ip)