From 3ff87ca7247a6a6edbcfc497adf90372f30909b4 Mon Sep 17 00:00:00 2001 From: Ruakij Date: Fri, 31 Mar 2023 17:56:32 +0200 Subject: [PATCH] Convert Ip to IPNet --- cmd/app/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/app/main.go b/cmd/app/main.go index 168233b..dd8d603 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -91,14 +91,14 @@ func main() { // Convert the IPv4 allowed-ip to an IPv6 address ipv6Suffix := fmt.Sprintf("%02x%02x", allowedIP.IP[2], allowedIP.IP[3]) ipv6Address := ipv6Prefix + ipv6Suffix + "/128" - ipv6, err := netlink.ParseAddr(ipv6Address) + ipv6, err := netlink.ParseIPNet(ipv6Address) if err != nil { logger.Warn.Printf("Couldnt parse IPv6 address %s of peer %s: %s", ipv6Address, peer.PublicKey, err) continue } // Add the IPv6 allowed-ip to the peer - allowedIPs = append(allowedIPs, *ipv6.IPNet) + allowedIPs = append(allowedIPs, *ipv6) } }