Browse Source

add ext client check for endpoint nil

Abhishek Kondur 2 năm trước cách đây
mục cha
commit
5bc94bcc0b
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      nm-proxy/manager/manager.go

+ 2 - 1
nm-proxy/manager/manager.go

@@ -226,7 +226,7 @@ func (m *ManagerAction) AddInterfaceToProxy() error {
 
 	for _, peerI := range m.Payload.Peers {
 		peerConf := m.Payload.PeerMap[peerI.PublicKey.String()]
-		if peerI.Endpoint == nil && !peerConf.IsExtClient {
+		if peerI.Endpoint == nil && (!peerConf.IsAttachedExtClient || !peerConf.IsExtClient) {
 			log.Println("Endpoint nil for peer: ", peerI.PublicKey.String())
 			continue
 		}
@@ -279,6 +279,7 @@ func (m *ManagerAction) AddInterfaceToProxy() error {
 				addExtClient := false
 				defer func() {
 					if addExtClient {
+						log.Println("GOT ENDPOINT for Extclient adding peer...")
 						common.PeerKeyHashMap[fmt.Sprintf("%x", md5.Sum([]byte(peer.PublicKey.String())))] = common.RemotePeer{
 							Interface:           wgInterface.Name,
 							PeerKey:             peer.PublicKey.String(),