dhcp4d: fix IP address comparison
AFAICT, this wasn’t actually a bug: canLease performs the correct check.
This commit is contained in:
parent
0d2e89cebf
commit
c7be96ac2e
@ -16,7 +16,6 @@
|
|||||||
package dhcp4d
|
package dhcp4d
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net"
|
"net"
|
||||||
@ -226,7 +225,7 @@ func (h *Handler) serveDHCP(p dhcp4.Packet, msgType dhcp4.MessageType, options d
|
|||||||
hwAddr := p.CHAddr().String()
|
hwAddr := p.CHAddr().String()
|
||||||
|
|
||||||
// try to offer the requested IP, if any and available
|
// try to offer the requested IP, if any and available
|
||||||
if !bytes.Equal(reqIP.To4(), net.IPv4zero) {
|
if !reqIP.To4().Equal(net.IPv4zero) {
|
||||||
free = h.canLease(reqIP, hwAddr)
|
free = h.canLease(reqIP, hwAddr)
|
||||||
//log.Printf("canLease(%v, %s) = %d", reqIP, hwAddr, free)
|
//log.Printf("canLease(%v, %s) = %d", reqIP, hwAddr, free)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user