Navigation


Changeset 749:2557127f3c8b in freeDiameter for libfdcore/peers.c


Ignore:
Timestamp:
Aug 8, 2011, 4:03:49 AM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

fix bug reported by Vjacheslav Chekushin on the mailing-list (thanks\!)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/peers.c

    r743 r749  
    456456        msg = *cer;
    457457       
    458         /* If needed, resolve the dictioanry model for Origin-Host */
     458        /* If needed, resolve the dictionary model for Origin-Host */
    459459        CHECK_POSIX( pthread_mutex_lock(&cache_avp_lock) );
    460460        if (!avp_oh_model) {
     
    471471        CHECK_FCT( fd_msg_avp_hdr ( avp_oh, &avp_hdr ) );
    472472       
    473         /* First, check if the Origin-Host value */
     473        /* First, check if the Origin-Host value is valid */
    474474        if (!fd_os_is_valid_DiameterIdentity(avp_hdr->avp_value->os.data, avp_hdr->avp_value->os.len)) {
    475475                TRACE_DEBUG(INFO, "Received new CER with invalid Origin-Host");
     
    489489        for (li = fd_g_peers.next; li != &fd_g_peers; li = li->next) {
    490490                int cmp, cont;
    491                 peer = (struct fd_peer *)li->o;
     491                peer = (struct fd_peer *)li;
    492492                cmp = fd_os_almostcasesrch( avp_hdr->avp_value->os.data, avp_hdr->avp_value->os.len, peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, &cont );
    493                 if (cmp < 0) {
     493                if (cmp > 0) {
    494494                        li_inf = li;
    495                         continue;
    496495                }
    497496                if (cmp == 0) {
     
    520519                peer->p_hdr.info.config.pic_lft         = 3600; /* 1 hour without any message
    521520                -- RFC3539 states that this must not be inferior to BRINGDOWN_INTERVAL = 5 minutes */
     521                CHECK_FCT_DO( ret = fd_p_expi_update( peer ), goto out );
     522
    522523               
    523524                /* Insert the new peer in the list (the PSM will take care of setting the expiry after validation) */
Note: See TracChangeset for help on using the changeset viewer.