Merge pull request #403 from mrjana/overlay

Sometimes fdb points to wrong vtep
This commit is contained in:
Madhu Venugopal 2015-07-23 05:09:02 +05:30
commit 413224ea84
1 changed files with 6 additions and 2 deletions

View File

@ -190,9 +190,13 @@ func (d *driver) peerDbUpdateSandbox(nid types.UUID) {
continue
}
// Go captures variables by reference. The pEntry could be
// pointing to the same memory location for every iteration. Make
// a copy of pEntry before capturing it in the following closure.
entry := pEntry
op := func() {
if err := d.peerAdd(nid, pEntry.eid, pKey.peerIP,
pKey.peerMac, pEntry.vtep,
if err := d.peerAdd(nid, entry.eid, pKey.peerIP,
pKey.peerMac, entry.vtep,
false); err != nil {
fmt.Printf("peerdbupdate in sandbox failed for ip %s and mac %s: %v",
pKey.peerIP, pKey.peerMac, err)