Changeset 13:ef9ef3bf4752 in freeDiameter for freeDiameter/fdd.y
- Timestamp:
- Sep 30, 2009, 6:25:46 PM (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
freeDiameter/fdd.y
r12 r13 210 210 memset(ep, 0, sizeof(struct fd_endpoint)); 211 211 fd_list_init(&ep->chain, NULL); 212 ep->meta.conf = 1; 212 213 213 214 memset(&hints, 0, sizeof(hints)); 214 215 hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; 215 216 ret = getaddrinfo($3, NULL, &hints, &ai); 216 if (ret) { yyerror (&yylloc, conf, gai_strerror(ret)); YYERROR; }217 217 if (ret) { yyerror (&yylloc, conf, gai_strerror(ret)); free(ep); YYERROR; } 218 ASSERT( ai->ai_addrlen <= sizeof(sSS) ); 218 219 memcpy(&ep->ss, ai->ai_addr, ai->ai_addrlen); 219 220 free($3); … … 426 427 memset(ep, 0, sizeof(struct fd_endpoint)); 427 428 fd_list_init(&ep->chain, NULL); 428 429 ep->meta.conf = 1; 429 430 memset(&hints, 0, sizeof(hints)); 430 hints.ai_flags = AI_ADDRCONFIG ;431 hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICHOST; 431 432 ret = getaddrinfo($4, NULL, &hints, &ai); 432 if (ret) { yyerror (&yylloc, conf, gai_strerror(ret)); YYERROR; } 433 if (ret == EAI_NONAME) { 434 /* The name was maybe not numeric, try again */ 435 ep->meta.disc = 1; 436 hints.ai_flags &= ~ AI_NUMERICHOST; 437 ret = getaddrinfo($4, NULL, &hints, &ai); 438 } 439 if (ret) { yyerror (&yylloc, conf, gai_strerror(ret)); free(ep); YYERROR; } 433 440 434 441 memcpy(&ep->ss, ai->ai_addr, ai->ai_addrlen);
Note: See TracChangeset
for help on using the changeset viewer.