Quellcode durchsuchen

routing option: allow mesh and VPN behaviour coexist

Artem Lukyanov vor 3 Jahren
Ursprung
Commit
853c0bba97
1 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen
  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