Browse Source

fixed debug mesasge of the network layer - showing the remote socket and not the own one

Stasik0 8 years ago
parent
commit
e14b5a3c50
1 changed files with 1 additions and 1 deletions
  1. 1 1
      plugins/networklayer_tcp.c

+ 1 - 1
plugins/networklayer_tcp.c

@@ -305,7 +305,7 @@ ServerNetworkLayerTCP_add(ServerNetworkLayerTCP *layer, UA_Int32 newsockfd) {
 
     struct sockaddr_in addr;
     socklen_t addrlen = sizeof(struct sockaddr_in);
-    getsockname(newsockfd, (struct sockaddr*)&addr, &addrlen);
+    getpeername(newsockfd, (struct sockaddr*)&addr, &addrlen);
     UA_LOG_INFO(layer->logger, UA_LOGCATEGORY_NETWORK, "New Connection %i over TCP from %s:%d",
                 newsockfd, inet_ntoa(addr.sin_addr), ntohs(addr.sin_port));
     UA_Connection_init(c);