aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ippool.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-08 23:27:22 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-09 22:14:53 +0200
commit949e50e02bb1af911dca820f21a11232f615e106 (patch)
tree54df2271d331ba2b268d264fe690512e250ab319 /lib/ippool.c
parent714a41bf66932bb6b383cd4573d1eff51aaf50dd (diff)
IPv6: Implement IPv6 prefix assignment via ICMPv6 router advertisement
The 3GPP specs are quite strange when it comes to how an IPv6 address or rather prefix is assigned to an IPv6 PDP context. The designated method for allocating the IPv6 address via the PDP EUA (End User Address) Information Element in the GTP signalling plane is *not* used to allocate the address/prefix. Instead, the EUA is used to allocate an "interface identifier" to the MS, which it the uses to derive its link-local source address to send a router solicitation. The GGSN subsequently answers witha router advertisement, advertising a single/64 prefix, whihcthe MS then uses to generate it's real IPv6 source address for subsequent communication. Change-Id: Icddf7d30e01d76a4784bcef5787b36f52f703a9f
Diffstat (limited to 'lib/ippool.c')
-rw-r--r--lib/ippool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ippool.c b/lib/ippool.c
index 683d2d8..1729ec7 100644
--- a/lib/ippool.c
+++ b/lib/ippool.c
@@ -210,8 +210,8 @@ int ippool_new(struct ippool_t **this, const char *dyn, const char *stat,
}
/* we want to work with /64 prefixes, i.e. allocate /64 prefixes rather
* than /128 (single IPv6 addresses) */
- if (addr->len == sizeof(in6_addr))
- addr->len = 64/8;
+ if (addr.len == sizeof(struct in6_addr))
+ addr.len = 64/8;
/* Set IPPOOL_NONETWORK if IPPOOL_NOGATEWAY is set */
if (flags & IPPOOL_NOGATEWAY) {
@@ -453,7 +453,7 @@ int ippool_newip(struct ippool_t *this, struct ippoolm_t **member,
return -GTPCAUSE_SYS_FAIL; /* Allready in use / Should not happen */
}
- if (p2->addr.len != addr->len) {
+ if (p2->addr.len != addr->len && !(addr->len == 16 && p2->addr.len == 8)) {
SYS_ERR(DIP, LOGL_ERROR, 0, "MS requested unsupported PDP context type");
return -GTPCAUSE_UNKNOWN_PDP;
}