summaryrefslogtreecommitdiffhomepage
path: root/device/uapi.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-06-03 13:51:03 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2021-06-03 13:51:03 +0200
commit4a57024b94edf23a20f1e4289052d0717227683b (patch)
tree1449ee35b5f8e8d585504547cb855acc78153dff /device/uapi.go
parent64cb82f2b3f5207f025a1c7ddf4d3043887d5712 (diff)
device: reduce size of trie struct
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'device/uapi.go')
-rw-r--r--device/uapi.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/device/uapi.go b/device/uapi.go
index 659af0a..66ecd48 100644
--- a/device/uapi.go
+++ b/device/uapi.go
@@ -121,7 +121,7 @@ func (device *Device) IpcGetOperation(w io.Writer) error {
sendf("rx_bytes=%d", atomic.LoadUint64(&peer.stats.rxBytes))
sendf("persistent_keepalive_interval=%d", atomic.LoadUint32(&peer.persistentKeepaliveInterval))
- device.allowedips.EntriesForPeer(peer, func(ip net.IP, cidr uint) bool {
+ device.allowedips.EntriesForPeer(peer, func(ip net.IP, cidr uint8) bool {
sendf("allowed_ip=%s/%d", ip.String(), cidr)
return true
})
@@ -379,7 +379,7 @@ func (device *Device) handlePeerLine(peer *ipcSetPeer, key, value string) error
return nil
}
ones, _ := network.Mask.Size()
- device.allowedips.Insert(network.IP, uint(ones), peer.Peer)
+ device.allowedips.Insert(network.IP, uint8(ones), peer.Peer)
case "protocol_version":
if value != "1" {