Revision 242c0de2 topology-ALTO.c

View differences:

topology-ALTO.c
88 88
 * IP string returned by node_addr() via inet_aton().
89 89
 */
90 90
static void node_convert_addr(const struct nodeID* node, struct in_addr* addr) {
91
  int len, rescode;
92
  char peerIP[64];
93
  const char* peerAddr = node_addr(node);
91
  int rescode;
92

  
93
//  const char* peerAddr = node_addr(node);
94 94

  
95 95
  /* extract IP string without port */
96
  const char* tmp = strstr(peerAddr, ":");
97
  if (tmp) len = tmp-peerAddr;	/* calc len of IP string */
98
  else len = strlen(peerAddr)+1;
99
  memcpy(peerIP, peerAddr, len);
100
  peerIP[len] = 0;	/* trailing zero */
96
  const char *peerIP = node_ip(node);
101 97

  
102
  /*dprintf("%d. peer addr = %s IP = %s\n", p, peerAddr, peerIP);*/
98
//  fprintf(stderr,"peer addr = %s IP = %s\n", peerAddr, peerIP);
103 99

  
104 100
  /* fill in IP addr */
105 101
  rescode = inet_aton(peerIP, addr);

Also available in: Unified diff