diff --git a/nm-proxy/manager/manager.go b/nm-proxy/manager/manager.go index a6e8ce54..e62de9b7 100644 --- a/nm-proxy/manager/manager.go +++ b/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 } diff --git a/nm-proxy/server/server.go b/nm-proxy/server/server.go index 9188a2e3..e66421a2 100644 --- a/nm-proxy/server/server.go +++ b/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) }