aboutsummaryrefslogtreecommitdiffstats
path: root/lib/in46_addr.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-08-08 18:10:43 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-09 22:37:57 +0200
commitd4d6e09fd29e23e28960959ca488e1481339571e (patch)
treee81c31b22f6ee885d1d60838d1c33ff14f02ff6b /lib/in46_addr.c
parent365f8fa4628b371551d6f5b20651ac06239f905d (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 'lib/in46_addr.c')
-rw-r--r--lib/in46_addr.c2
1 files changed, 2 insertions, 0 deletions
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 @@ int in46a_to_af(const struct in46_addr *in)
switch (in->len) {
case 4:
return AF_INET;
+ case 8:
case 16:
return AF_INET6;
default:
@@ -175,6 +176,7 @@ int in46a_to_eua(const struct in46_addr *src, struct ul66_t *eua)
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 */