Navigation


Changeset 738:d666051658bd in freeDiameter for libfdcore/p_ce.c


Ignore:
Timestamp:
Mar 2, 2011, 6:21:59 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Fix broken 'almostcasecmp' logic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/p_ce.c

    r725 r738  
    304304                               
    305305                                /* We check that the value matches what we know, otherwise disconnect the peer */
    306                                 if (fd_os_almostcasecmp(hdr->avp_value->os.data, hdr->avp_value->os.len,
    307                                                         peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen)) {
     306                                if (fd_os_almostcasesrch(hdr->avp_value->os.data, hdr->avp_value->os.len,
     307                                                        peer->p_hdr.info.pi_diamid, peer->p_hdr.info.pi_diamidlen, NULL)) {
    308308                                        TRACE_DEBUG(INFO, "Received a message with Origin-Host set to '%.*s' while expecting '%s'\n",
    309309                                                        hdr->avp_value->os.len, hdr->avp_value->os.data, peer->p_hdr.info.pi_diamid);
     
    813813        if (peer->p_hdr.info.config.pic_realm) {
    814814                size_t len = strlen(peer->p_hdr.info.config.pic_realm);
    815                 if (fd_os_almostcasecmp(peer->p_hdr.info.config.pic_realm, len, peer->p_hdr.info.runtime.pir_realm, peer->p_hdr.info.runtime.pir_realmlen)) {
     815                if (fd_os_almostcasesrch(peer->p_hdr.info.config.pic_realm, len, peer->p_hdr.info.runtime.pir_realm, peer->p_hdr.info.runtime.pir_realmlen, NULL)) {
    816816                        TRACE_DEBUG(INFO, "Rejected CER from peer '%s', realm mismatch with configured value (returning DIAMETER_UNKNOWN_PEER).\n", peer->p_hdr.info.pi_diamid);
    817817                        pei.pei_errcode = "DIAMETER_UNKNOWN_PEER"; /* maybe AVP_NOT_ALLOWED would be better fit? */
Note: See TracChangeset for help on using the changeset viewer.