Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix for creating 2 interface entries when IP is configured, and when interface comes up as L2. #116

Merged
merged 9 commits into from
Sep 13, 2019
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