Skip to content

Commit

Permalink
Improve error message on healthcheck faiure
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzhang committed Oct 1, 2024
1 parent cdba66b commit a96c64a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down

0 comments on commit a96c64a

Please sign in to comment.