From d4d6e09fd29e23e28960959ca488e1481339571e Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 8 Aug 2017 18:10:43 +0200 Subject: 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 --- lib/in46_addr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/in46_addr.c') 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 */ -- cgit v1.2.3