Mercurial > hg > freeDiameter
changeset 712:886e935f7513
Fixed decorated NAI handing in case of messages without User-Name AVP
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Tue, 15 Feb 2011 10:51:31 +0900 |
parents | f7c665948e0c |
children | 14c07fc54656 |
files | libfdcore/routing_dispatch.c tests/testappacct.c |
diffstat | 2 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libfdcore/routing_dispatch.c Thu Feb 10 17:19:52 2011 +0900 +++ b/libfdcore/routing_dispatch.c Tue Feb 15 10:51:31 2011 +0900 @@ -678,12 +678,14 @@ /* test for decorated NAI (RFC5729 section 4.4) */ /* Handle the decorated NAI */ - CHECK_FCT_DO( process_decorated_NAI(&is_nai, un_val, dr_val), - { - /* If the process failed, we assume it is because of the AVP format */ - CHECK_FCT( return_error( pmsg, "DIAMETER_INVALID_AVP_VALUE", "Failed to process decorated NAI", un) ); - return 0; - } ); + if (un_val) { + CHECK_FCT_DO( process_decorated_NAI(&is_nai, un_val, dr_val), + { + /* If the process failed, we assume it is because of the AVP format */ + CHECK_FCT( return_error( pmsg, "DIAMETER_INVALID_AVP_VALUE", "Failed to process decorated NAI", un) ); + return 0; + } ); + } if (is_nai) { /* We have transformed the AVP, now submit it again in the queue */
--- a/tests/testappacct.c Thu Feb 10 17:19:52 2011 +0900 +++ b/tests/testappacct.c Tue Feb 15 10:51:31 2011 +0900 @@ -44,7 +44,7 @@ DROP TABLE <table>; CREATE TABLE <table> ( - ts timestamp with time zone NOT NULL, + recorded_on timestamp with time zone NOT NULL, "Accounting-Record-Type" integer, "Session-Id" bytea, "Accounting-Record-Number" integer,