1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Lock linux namespace structure when adding neighbors

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
This commit is contained in:
Santhosh Manohar 2017-03-02 00:04:09 -08:00
parent 1a8c8e9a61
commit 200410dd18

View file

@ -147,7 +147,9 @@ func (n *networkNamespace) AddNeighbor(dstIP net.IP, dstMac net.HardwareAddr, op
return fmt.Errorf("could not add neighbor entry: %v", err)
}
n.Lock()
n.neighbors = append(n.neighbors, nh)
n.Unlock()
return nil
}