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
diff --git a/lib/in46_addr.c b/lib/in46_addr.c
index a220583..1785377 100644
--- a/lib/in46_addr.c
+++ b/lib/in46_addr.c
@@ -25,6 +25,7 @@
switch (in->len) {
case 4:
return AF_INET;
+ case 8:
case 16:
return AF_INET6;
default:
@@ -175,6 +176,7 @@
eua->v[1] = 0x21; /* IPv4 */
memcpy(&eua->v[2], &src->v4, 4); /* Copy a 4 byte address */
break;
+ case 8:
case 16:
eua->l = 18;
eua->v[0] = 0xf1; /* IETF */