[MERGED] openggsn[master]: gtp-kernel: Fix tunnel creation/removal for GTP Version 1

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Feb 23 20:13:41 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: gtp-kernel: Fix tunnel creation/removal for GTP Version 1
......................................................................


gtp-kernel: Fix tunnel creation/removal for GTP Version 1

When Linux Kernel GTP-U support is enabled, OpenGGSN so far only worked
with GTPv0,but not with GTPv1, as the TEI values were not correctly
configured.  This patch fixes the initialzation of the local and remote
TEI before using libgtpnl to create a tunnel context in the kernel.

Change-Id: I3e953ff5b4ab44c26dbbe20d18b61038fa57ff32
---
M ggsn/gtp-kernel.c
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/ggsn/gtp-kernel.c b/ggsn/gtp-kernel.c
index 93dea23..dbe5a9f 100644
--- a/ggsn/gtp-kernel.c
+++ b/ggsn/gtp-kernel.c
@@ -192,7 +192,10 @@
 		gtp_tunnel_set_tid(t, pdp_gettid(pdp->imsi, pdp->nsapi));
 		gtp_tunnel_set_flowid(t, pdp->flru);
 	} else {
-		gtp_tunnel_set_tid(t, pdp->teid_gn); /* GTPIE_TEI_DI */
+		gtp_tunnel_set_i_tei(t, pdp->teid_own);
+		/* use the TEI advertised by SGSN when sending packets
+		 * towards the SGSN */
+		gtp_tunnel_set_o_tei(t, pdp->teid_gn);
 	}
 
 	ret = gtp_add_tunnel(gtp_nl.genl_id, gtp_nl.nl, t);
@@ -221,7 +224,7 @@
 		gtp_tunnel_set_tid(t, pdp_gettid(pdp->imsi, pdp->nsapi));
 		gtp_tunnel_set_flowid(t, pdp->flru);
 	} else {
-		gtp_tunnel_set_tid(t, pdp->teid_gn); /* GTPIE_TEI_DI */
+		gtp_tunnel_set_i_tei(t, pdp->teid_own);
 	}
 
 	ret = gtp_del_tunnel(gtp_nl.genl_id, gtp_nl.nl, t);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3e953ff5b4ab44c26dbbe20d18b61038fa57ff32
Gerrit-PatchSet: 2
Gerrit-Project: openggsn
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list