diff --git a/cmd/connect.go b/cmd/connect.go index 49e6746..3352149 100644 --- a/cmd/connect.go +++ b/cmd/connect.go @@ -92,7 +92,7 @@ func runConnect(cmd *cobra.Command, args []string) error { log.Println("Connected...") if !client.CheckConnection(healthCheckTimeout, ctx) { - return fmt.Errorf("connection immediately turned bad after connecting: %v", err) + return fmt.Errorf("connection failed initial healthcheck after %v", healthCheckTimeout) } for { diff --git a/lib/client.go b/lib/client.go index 7b980e3..aca8348 100644 --- a/lib/client.go +++ b/lib/client.go @@ -93,7 +93,7 @@ func (c *Client) updateInterface(resp connectResponse) error { if cidr != c.wgCidr { link := c.link() - if c.wgCidr != (netip.Prefix{}) { + if c.wgCidr.IsValid() { oldIpnet := prefixToIPNet(c.wgCidr) err = netlink.AddrDel(link, &netlink.Addr{IPNet: &oldIpnet})