Navigation


Changeset 1559:2dbc816d48f4 in freeDiameter for libfdcore


Ignore:
Timestamp:
Oct 27, 2020, 6:50:04 PM (3 years ago)
Author:
Thomas Klausner <wiz@gatalith.at>
Branch:
default
Phase:
public
Message:

Fail when a peer with empty Origin-Realm tries to connect.

Empty Origin-Realms cause problems in the routing code later.

Reduce warnings when reporting an empty Failed-AVP;
both avp_source and avp_rawdata are NULL in this case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libfdcore/p_ce.c

    r1554 r1559  
    337337                                }
    338338                               
     339                                /* Origin-Realm is empty */
     340                                if (hdr->avp_value->os.len == 0) {
     341                                        error->pei_errcode = "DIAMETER_INVALID_AVP_VALUE";
     342                                        error->pei_message = "Your Origin-Realm is empty.";
     343                                        error->pei_avp = avp;
     344                                        return EINVAL;
     345                                }
     346
    339347                                /* Save the value */
    340348                                CHECK_MALLOC(  peer->p_hdr.info.runtime.pir_realm = os0dup( hdr->avp_value->os.data, hdr->avp_value->os.len )  );
Note: See TracChangeset for help on using the changeset viewer.