aboutsummaryrefslogtreecommitdiffstats
path: root/gtp
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-12 22:43:21 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-12 22:53:59 +0200
commit54d082e5e8a3bd45a46dde1162015954b9047f69 (patch)
treef25c58323215cc3aa429371ad23ddc7845e65503 /gtp
parentb10ee08c2ff4df8acc053d2ad9a2cba04e757061 (diff)
libgtp: Add missing mandatory IEs in GTP Error Indication
Diffstat (limited to 'gtp')
-rw-r--r--gtp/gtp.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gtp/gtp.c b/gtp/gtp.c
index 4aa6eb1..a4e8e2b 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -2555,7 +2555,7 @@ int gtp_delete_pdp_conf(struct gsn_t *gsn, int version,
return 0;
}
-/* Send Error Indication (response to a GPDU message */
+/* Send Error Indication (response to a GPDU message) - 3GPP TS 29.060 7.3.7 */
int gtp_error_ind_resp(struct gsn_t *gsn, int version,
struct sockaddr_in *peer, int fd,
void *pack, unsigned len)
@@ -2563,6 +2563,16 @@ int gtp_error_ind_resp(struct gsn_t *gsn, int version,
union gtp_packet packet;
unsigned int length = get_default_gtp(version, GTP_ERROR, &packet);
+ if (version == 1) {
+ /* Mandatory 7.7.13 TEI Data I */
+ gtpie_tv4(&packet, &length, GTP_MAX, GTPIE_TEI_DI,
+ ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei));
+
+ /* Mandatory 7.7.32 GSN Address */
+ gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_GSN_ADDR,
+ sizeof(gsn->gsnu), &gsn->gsnu);
+ }
+
return gtp_resp(version, gsn, NULL, &packet, length, peer, fd,
get_seq(pack), get_tid(pack));
}