git://git.halfball.org
/
cni.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19c18ab
)
host-local: detect missing subnet and error out
author
Stefan Junker
<mail@stefanjunker.de>
Thu, 12 Nov 2015 19:00:48 +0000
(20:00 +0100)
committer
Stefan Junker
<mail@stefanjunker.de>
Wed, 25 Nov 2015 20:18:48 +0000
(21:18 +0100)
plugins/ipam/host-local/allocator.go
patch
|
blob
|
history
diff --git
a/plugins/ipam/host-local/allocator.go
b/plugins/ipam/host-local/allocator.go
index
c333952
..
159e2cb
100644
(file)
--- a/
plugins/ipam/host-local/allocator.go
+++ b/
plugins/ipam/host-local/allocator.go
@@
-142,6
+142,9
@@
func (a *IPAllocator) Release(id string) error {
}
func networkRange(ipnet *net.IPNet) (net.IP, net.IP, error) {
+ if ipnet.IP == nil {
+ return nil, nil, fmt.Errorf("missing field %q in IPAM configuration", "subnet")
+ }
ip := ipnet.IP.To4()
if ip == nil {
ip = ipnet.IP.To16()