Navigation


Changeset 13:ef9ef3bf4752 in freeDiameter for freeDiameter/fdd.y


Ignore:
Timestamp:
Sep 30, 2009, 6:25:46 PM (15 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Progress on peer state machine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • freeDiameter/fdd.y

    r12 r13  
    210210                                memset(ep, 0, sizeof(struct fd_endpoint));
    211211                                fd_list_init(&ep->chain, NULL);
     212                                ep->meta.conf = 1;
    212213                               
    213214                                memset(&hints, 0, sizeof(hints));
    214215                                hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
    215216                                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) );
    218219                                memcpy(&ep->ss, ai->ai_addr, ai->ai_addrlen);
    219220                                free($3);
     
    426427                                memset(ep, 0, sizeof(struct fd_endpoint));
    427428                                fd_list_init(&ep->chain, NULL);
    428                                
     429                                ep->meta.conf = 1;
    429430                                memset(&hints, 0, sizeof(hints));
    430                                 hints.ai_flags = AI_ADDRCONFIG;
     431                                hints.ai_flags = AI_ADDRCONFIG | AI_NUMERICHOST;
    431432                                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; }
    433440                               
    434441                                memcpy(&ep->ss, ai->ai_addr, ai->ai_addrlen);
Note: See TracChangeset for help on using the changeset viewer.