[MERGED] openggsn[master]: libgtp: Add missing mandatory IEs in GTP Error Indication

2017-08-12 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: libgtp: Add missing mandatory IEs in GTP Error Indication
..


libgtp: Add missing mandatory IEs in GTP Error Indication

Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e
---
M gtp/gtp.c
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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 @@
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 @@
union gtp_packet packet;
unsigned int length = get_default_gtp(version, GTP_ERROR, );
 
+   if (version == 1) {
+   /* Mandatory 7.7.13 TEI Data I */
+   gtpie_tv4(, , GTP_MAX, GTPIE_TEI_DI,
+ ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei));
+
+   /* Mandatory 7.7.32 GSN Address */
+   gtpie_tlv(, , GTP_MAX, GTPIE_GSN_ADDR,
+ sizeof(gsn->gsnu), >gsnu);
+   }
+
return gtp_resp(version, gsn, NULL, , length, peer, fd,
get_seq(pack), get_tid(pack));
 }

-- 
To view, visit https://gerrit.osmocom.org/3502
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e
Gerrit-PatchSet: 1
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


openggsn[master]: libgtp: Add missing mandatory IEs in GTP Error Indication

2017-08-12 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/3502
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e
Gerrit-PatchSet: 1
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[PATCH] openggsn[master]: libgtp: Add missing mandatory IEs in GTP Error Indication

2017-08-12 Thread Harald Welte

Review at  https://gerrit.osmocom.org/3502

libgtp: Add missing mandatory IEs in GTP Error Indication

Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e
---
M gtp/gtp.c
1 file changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openggsn refs/changes/02/3502/1

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 @@
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 @@
union gtp_packet packet;
unsigned int length = get_default_gtp(version, GTP_ERROR, );
 
+   if (version == 1) {
+   /* Mandatory 7.7.13 TEI Data I */
+   gtpie_tv4(, , GTP_MAX, GTPIE_TEI_DI,
+ ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei));
+
+   /* Mandatory 7.7.32 GSN Address */
+   gtpie_tlv(, , GTP_MAX, GTPIE_GSN_ADDR,
+ sizeof(gsn->gsnu), >gsnu);
+   }
+
return gtp_resp(version, gsn, NULL, , length, peer, fd,
get_seq(pack), get_tid(pack));
 }

-- 
To view, visit https://gerrit.osmocom.org/3502
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iadd1fe3de7c476576a4409f22f5e84e9eade6b6e
Gerrit-PatchSet: 1
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte