aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-11-08 14:09:51 +0900
committerHarald Welte <laforge@gnumonks.org>2017-11-13 23:59:40 +0900
commit490782d18e6bbab8b5f4f8dcef4d4f5ab310af6a (patch)
tree205f5704574ed9006a6cfd57258e188fd1adb965
parente3c5918aeea8639c8c9a36047fd078ddc4eab4ef (diff)
gtp-kernel: Re-add support for kernel GTP-U acceleration
When we branched off osmo-ggsn from the old openggsn code base, the support for kernel-gtp got temporarily removed. This patch re-introduces support for handling the GTP-U plane in the Linux kernel by means of libgtpnl + the kernel GTP-U driver. This only works for IPv4 at the moment, until the kernel GTP-U code gains IPv6 support. Kernel GTP currently also is restricted to a single APN per GSN. Change-Id: Ieb1bc1bd0d51d41947f0abd6ebbc2e5d102592d6
-rw-r--r--ggsn/ggsn.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c
index 4af044e..2937b04 100644
--- a/ggsn/ggsn.c
+++ b/ggsn/ggsn.c
@@ -259,12 +259,16 @@ int apn_start(struct apn_ctx *apn)
apn->tun.tun->priv = apn;
break;
case APN_GTPU_MODE_KERNEL_GTP:
- LOGPAPN(LOGL_ERROR, apn, "FIXME: Kernel GTP\n");
-#if 0
+ if (apn->cfg.apn_type_mask & (APN_TYPE_IPv6|APN_TYPE_IPv4v6)) {
+ LOGPAPN(LOGL_ERROR, apn, "Kernel GTP currently supports only IPv4\n");
+ apn_stop(apn, false);
+ return -1;
+ }
+ LOGPAPN(LOGL_ERROR, apn, "Setting up Kernel GTP\n");
/* use GTP kernel module for data packet encapsulation */
- if (gtp_kernel_init(gsn, &net.v4, prefixlen, net_arg) < 0)
- goto err;
-#endif
+ if (gtp_kernel_init(apn->ggsn->gsn, &apn->v4.cfg.ifconfig_prefix, apn->tun.cfg.ipup_script) < 0) {
+ return -1;
+ }
break;
default:
LOGPAPN(LOGL_ERROR, apn, "Unknown GTPU Mode %d\n", apn->cfg.gtpu_mode);