summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2015-05-13 14:29:51 +0200
committerSteven Barth <steven@midlink.org>2015-05-13 14:29:51 +0200
commitdc671c62730d9ff20e7cf06322fb8db203e7bf3f (patch)
tree8306ef42b53524769d6089c75fac354dc224cbee
parent681ba23d0b3678a9a0c90ef938cd1d48f2ee6046 (diff)
dhcpv6-pd: ignore /64 on interface
-rw-r--r--src/dhcpv6-ia.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c
index 69fda07..a6ea66f 100644
--- a/src/dhcpv6-ia.c
+++ b/src/dhcpv6-ia.c
@@ -581,7 +581,8 @@ static void update(struct interface *iface)
int minprefix = -1;
for (int i = 0; i < len; ++i) {
- if (addr[i].preferred > 0 && addr[i].prefix > minprefix)
+ if (addr[i].preferred > 0 && addr[i].prefix < 64 &&
+ addr[i].prefix > minprefix)
minprefix = addr[i].prefix;
addr[i].addr.s6_addr32[3] = 0;
@@ -756,7 +757,8 @@ static size_t append_reply(uint8_t *buf, size_t buflen, uint16_t status,
size_t entrlen = sizeof(p) - 4;
if (datalen + entrlen + 4 > buflen ||
- (a->assigned == 0 && a->managed_size == 0))
+ (a->assigned == 0 && a->managed_size == 0) ||
+ (!a->managed_size && a->length < p.preferred))
continue;
memcpy(buf + datalen, &p, sizeof(p));