summaryrefslogtreecommitdiffhomepage
path: root/src/ubus.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-03-29 16:47:52 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-03-29 16:55:31 +0200
commitbc6c3ace738fd4eb28c06be533f6bbc75d0587a5 (patch)
tree6b5da6b00c2ba402fccf27fc80f75ed915c8ddac /src/ubus.c
parent6eb1e01b1a7cc5e73829bf2a050ba2cff57cbebd (diff)
ndp: keep an exact copy of IPv6 interface addresses
Don't reset the final 32 bit IPv6 host suffix when storing the IPv6 addresses in the interface structure. This will allow exact lookup aand return of IPv6 addresses stored in the interface structure when needed. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/ubus.c')
-rw-r--r--src/ubus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ubus.c b/src/ubus.c
index e9e2de3..d562c0f 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -107,8 +107,10 @@ static int handle_dhcpv6_leases(_unused struct ubus_context *ctx, _unused struct
addr = iface->ia_addr[i].addr;
if (lease->length == 128)
addr.s6_addr32[3] = htonl(lease->assigned);
- else
+ else {
addr.s6_addr32[1] |= htonl(lease->assigned);
+ addr.s6_addr32[2] = addr.s6_addr32[3] = 0;
+ }
char *c = blobmsg_alloc_string_buffer(&b, NULL, INET6_ADDRSTRLEN);
inet_ntop(AF_INET6, &addr, c, INET6_ADDRSTRLEN);