Browse Source

routing option: allow mesh and VPN behaviour coexist

Artem Lukyanov 3 years ago
parent
commit
853c0bba97
1 changed files with 3 additions and 1 deletions
  1. 3 1
      pkg/vpn/vpn.go

+ 3 - 1
pkg/vpn/vpn.go

@@ -197,7 +197,9 @@ func handleFrame(mgr streamManager, frame ethernet.Frame, c *Config, n *node.Nod
 
 	dst := dstIP.String()
 	if c.RouterAddress != "" && srcIP.Equal(ip) {
-		dst = c.RouterAddress
+		if _, found := ledger.GetKey(protocol.MachinesLedgerKey, dst); !found {
+			dst = c.RouterAddress
+		}
 	}
 
 	// Query the routing table