From e32139009b7d8392b6eb883f18a6991eeda7a085 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 2 Jun 2022 18:02:14 +0200 Subject: [PATCH] [SMF] Gn: Avoid building QoS Profile IE twice in UpdatePdpContextResp (#1574) --- src/smf/gn-build.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/src/smf/gn-build.c b/src/smf/gn-build.c index 0f8de74fe..4f80e591c 100644 --- a/src/smf/gn-build.c +++ b/src/smf/gn-build.c @@ -244,12 +244,12 @@ ogs_pkbuf_t *smf_gn_build_create_pdp_context_response( rsp->ggsn_address_for_user_traffic.len = gsn_len; /* QoS Profile: if PCRF changes Bearer QoS, this should be included. */ - if (sess->gtp.create_session_response_bearer_qos == true) { - build_qos_profile_from_session(&qos_pdec, sess); - rsp->quality_of_service_profile.presence = 1; - ogs_gtp1_build_qos_profile(&rsp->quality_of_service_profile, + if (sess->gtp.create_session_response_bearer_qos == true) { + build_qos_profile_from_session(&qos_pdec, sess); + rsp->quality_of_service_profile.presence = 1; + ogs_gtp1_build_qos_profile(&rsp->quality_of_service_profile, &qos_pdec, qos_pdec_buf, OGS_GTP1_QOS_PROFILE_MAX_LEN); - } + } /* TODO: Charging Gateway Address */ /* TODO: Alternative Charging Gateway Address */ @@ -433,21 +433,12 @@ ogs_pkbuf_t *smf_gn_build_update_pdp_context_response( rsp->ggsn_address_for_user_traffic.len = gsn_len; /* QoS Profile: if PCRF changes Bearer QoS, this should be included. */ - if (sess->gtp.create_session_response_bearer_qos == true) { - build_qos_profile_from_session(&qos_pdec, sess); - rsp->quality_of_service_profile.presence = 1; - ogs_gtp1_build_qos_profile(&rsp->quality_of_service_profile, + if (sess->gtp.create_session_response_bearer_qos == true) { + build_qos_profile_from_session(&qos_pdec, sess); + rsp->quality_of_service_profile.presence = 1; + ogs_gtp1_build_qos_profile(&rsp->quality_of_service_profile, &qos_pdec, qos_pdec_buf, OGS_GTP1_QOS_PROFILE_MAX_LEN); - } - - - /* QoS Profile: if PCRF changes Bearer QoS, this should be included. */ - if (sess->gtp.create_session_response_bearer_qos == true) { - build_qos_profile_from_session(&qos_pdec, sess); - rsp->quality_of_service_profile.presence = 1; - ogs_gtp1_build_qos_profile(&rsp->quality_of_service_profile, - &qos_pdec, qos_pdec_buf, OGS_GTP1_QOS_PROFILE_MAX_LEN); - } + } /* TODO: Charging Gateway Address */ /* TODO: Alternative Charging Gateway Address */