mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-09 13:39:39 -05:00
db: add sqlite "source of truth" schema
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
committed by
Kristoffer Dalby
parent
855c48aec2
commit
c6736dd6d6
@@ -17,6 +17,8 @@ import (
|
||||
"tailscale.com/net/tsaddr"
|
||||
)
|
||||
|
||||
var errGeneratedIPBytesInvalid = errors.New("generated ip bytes are invalid ip")
|
||||
|
||||
// IPAllocator is a singleton responsible for allocating
|
||||
// IP addresses for nodes and making sure the same
|
||||
// address is not handed out twice. There can only be one
|
||||
@@ -236,7 +238,7 @@ func randomNext(pfx netip.Prefix) (netip.Addr, error) {
|
||||
|
||||
ip, ok := netip.AddrFromSlice(valInRange.Bytes())
|
||||
if !ok {
|
||||
return netip.Addr{}, fmt.Errorf("generated ip bytes are invalid ip")
|
||||
return netip.Addr{}, errGeneratedIPBytesInvalid
|
||||
}
|
||||
|
||||
if !pfx.Contains(ip) {
|
||||
|
||||
Reference in New Issue
Block a user