Revision 67700aad src/net_helper-udp.c

View differences:

src/net_helper-udp.c
313 313
	char ip1[80], ip2[80];
314 314
	int port1,port2,res;
315 315

  
316
	port1=node_port(s1);
317
	port2=node_port(s2);
318
	node_ip(s1,ip1,80);
319
	node_ip(s2,ip2,80);
320

  
321
//	int res = (port1^port2)|strcmp(ip1,ip2);
322
//	fprintf(stderr,"Comparing %s:%d and %s:%d\n",ip1,port1,ip2,port2);
323
//	fprintf(stderr,"Result: %d\n",res);
324
	res  = strcmp(ip1,ip2);
325
	if (res!=0)
326
		return res;
327
	else
328
		return port1-port2;
329
//		return port1 == port2 ? 0 : 1;
330

  
331
//  return memcmp(&s1->addr, &s2->addr, sizeof(struct sockaddr_storage));
316
  if(s1 && s2)
317
  {
318
    port1=node_port(s1);
319
    port2=node_port(s2);
320
    node_ip(s1,ip1,80);
321
    node_ip(s2,ip2,80);
322

  
323
  //	int res = (port1^port2)|strcmp(ip1,ip2);
324
  //	fprintf(stderr,"Comparing %s:%d and %s:%d\n",ip1,port1,ip2,port2);
325
  //	fprintf(stderr,"Result: %d\n",res);
326
    res  = strcmp(ip1,ip2);
327
    if (res!=0)
328
      return res;
329
    else
330
      return port1-port2;
331
  //		return port1 == port2 ? 0 : 1;
332

  
333
  //  return memcmp(&s1->addr, &s2->addr, sizeof(struct sockaddr_storage));
334
  }
335
  else
336
    return 0;
332 337
}
333 338

  
334 339
int nodeid_dump(uint8_t *b, const struct nodeID *s, size_t max_write_size)

Also available in: Unified diff