diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-08-08 18:10:43 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-08-09 22:37:57 +0200 |
commit | d4d6e09fd29e23e28960959ca488e1481339571e (patch) | |
tree | e81c31b22f6ee885d1d60838d1c33ff14f02ff6b /ggsn/ggsn.c | |
parent | 365f8fa4628b371551d6f5b20651ac06239f905d (diff) |
ippool: Extend pool to work with /64 prefixes
In IPv6 GPRS, we actually don't want to allocate an individual v6
address (like in IPv4), but we want to allocate a prefix. The
standard prefix lengh is 8 bytes, i.e. a /64 prefix. This patch
extends the pool to be able to work with such v6 prefixes.
Change-Id: I0cf700b6baf195a2e5fbea000531f801acaaa443
Diffstat (limited to 'ggsn/ggsn.c')
-rw-r--r-- | ggsn/ggsn.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0629f9e..9b11884 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -241,7 +241,11 @@ int cb_tun_ind(struct tun_t *tun, void *pack, unsigned len) dst.len = 4; dst.v4.s_addr = iph->daddr; } else if (iph->version == 6) { - dst.len = 16; + /* Due to the fact that 3GPP requires an allocation of a + * /64 prefix to each MS, we must instruct + * ippool_getip() below to match only the leading /64 + * prefix, i.e. the first 8 bytes of the address */ + dst.len = 8; dst.v6 = ip6h->ip6_dst; } else { LOGP(DGGSN, LOGL_NOTICE, "non-IPv packet received from tun\n"); |