Browse Source

debug logs

Abhishek Kondur 2 years ago
parent
commit
a05193f6bb
2 changed files with 4 additions and 1 deletions
  1. 3 0
      nm-proxy/manager/manager.go
  2. 1 1
      nm-proxy/server/server.go

+ 3 - 0
nm-proxy/manager/manager.go

@@ -270,6 +270,7 @@ func (m *ManagerAction) AddInterfaceToProxy() error {
 				Interface:           ifaceName,
 				PeerKey:             peerI.PublicKey.String(),
 				IsExtClient:         peerConf.IsExtClient,
+				Endpoint:            peerI.Endpoint,
 				IsAttachedExtClient: peerConf.IsAttachedExtClient,
 			}
 		}
@@ -340,5 +341,7 @@ func (m *ManagerAction) AddInterfaceToProxy() error {
 			peerConf.IsExtClient, peerConf.IsAttachedExtClient, relayedTo)
 	}
 	log.Printf("------> PEERHASHMAP: %+v\n", common.PeerKeyHashMap)
+	log.Printf("-------> WgKeyHashMap: %+v\n", common.WgIfaceKeyMap)
+	log.Printf("-------> WgIFaceMap: %+v\n", common.WgIFaceMap)
 	return nil
 }

+ 1 - 1
nm-proxy/server/server.go

@@ -69,7 +69,7 @@ func (p *ProxyServer) Listen(ctx context.Context) {
 
 						log.Printf("-------->Forwarding the pkt to extClient  [ SourceIP: %s ], [ SourceKeyHash: %s ], [ DstIP: %s ], [ DstHashKey: %s ] \n",
 							source.String(), srcPeerKeyHash, val.Endpoint.String(), dstPeerKeyHash)
-						_, err = NmProxyServer.Server.WriteToUDP(buffer[:n+32], val.Endpoint)
+						_, err = NmProxyServer.Server.WriteToUDP(buffer[:n], val.Endpoint)
 						if err != nil {
 							log.Println("Failed to send to remote: ", err)
 						}