Mercurial > hg > freeDiameter
comparison libfdcore/p_ce.c @ 1559:2dbc816d48f4
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.
author | Thomas Klausner <wiz@gatalith.at> |
---|---|
date | Tue, 27 Oct 2020 10:50:04 +0100 |
parents | 566bb46cc73f |
children |
comparison
equal
deleted
inserted
replaced
1555:5e29c00d6576 | 1559:2dbc816d48f4 |
---|---|
334 error->pei_message = "Your Origin-Realm contains invalid characters."; | 334 error->pei_message = "Your Origin-Realm contains invalid characters."; |
335 error->pei_avp = avp; | 335 error->pei_avp = avp; |
336 return EINVAL; | 336 return EINVAL; |
337 } | 337 } |
338 | 338 |
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 | |
339 /* Save the value */ | 347 /* Save the value */ |
340 CHECK_MALLOC( peer->p_hdr.info.runtime.pir_realm = os0dup( hdr->avp_value->os.data, hdr->avp_value->os.len ) ); | 348 CHECK_MALLOC( peer->p_hdr.info.runtime.pir_realm = os0dup( hdr->avp_value->os.data, hdr->avp_value->os.len ) ); |
341 peer->p_hdr.info.runtime.pir_realmlen = hdr->avp_value->os.len; | 349 peer->p_hdr.info.runtime.pir_realmlen = hdr->avp_value->os.len; |
342 break; | 350 break; |
343 | 351 |