Skip to content

Commit

Permalink
Bugfix for creating 2 interface entries when IP is configured, and wh…
Browse files Browse the repository at this point in the history
…en interface comes up as L2. (#116)
  • Loading branch information
justinejose91 authored and jeff-yin committed Sep 13, 2019
1 parent af193f0 commit 78b12e8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/translib/intf_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 78b12e8

Please sign in to comment.