Skip to content

Commit

Permalink
Merge pull request #249 from caseydavenport/fix-nil
Browse files Browse the repository at this point in the history
Handle nil pools
  • Loading branch information
caseydavenport authored Nov 4, 2016
2 parents 2ae440e + d0d0fd1 commit ab49b47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/client/ipam_block_reader_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ func (rw blockReaderWriter) getAffineBlocks(host string, ver ipVersion, pool *cn
ids := []cnet.IPNet{}
for _, o := range datastoreObjs {
k := o.Key.(model.BlockAffinityKey)
if pool.Contains(k.CIDR.IPNet.IP) {

// Add the block if no IP pool was specified, or if an IP pool was specified
// and the block falls within the given IP pool.
if pool == nil || pool.Contains(k.CIDR.IPNet.IP) {
ids = append(ids, k.CIDR)
}
}
Expand Down

0 comments on commit ab49b47

Please sign in to comment.