Skip to content

Commit

Permalink
wireguard: try to fix ifacewatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
USA-RedDragon committed Feb 12, 2024
1 parent 00abbc4 commit 2c652a6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/ifacewatcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ func (w *Watcher) findTunnel(iface net.Interface) *models.Tunnel {
var tun models.Tunnel
if strings.HasPrefix(iface.Name, "wg") {
var err error
ip[3] -= 1
tun, err = models.FindTunnelByIP(w.db, ip) // AREDN tunnel IPs are always the interface IP if a server
if err != nil {
ip[3] += 1 // AREDN tunnel IPs are always the interface IP + 1 if a client
Expand Down

0 comments on commit 2c652a6

Please sign in to comment.