summaryrefslogtreecommitdiffhomepage
path: root/src/ndp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ndp.c')
-rw-r--r--src/ndp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ndp.c b/src/ndp.c
index b686262..8488fc5 100644
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -352,9 +352,9 @@ static int prefixcmp(const void *va, const void *vb)
// Check address update
static void check_addr_updates(struct interface *iface)
{
- struct odhcpd_ipaddr addr[RELAYD_MAX_ADDRS] = {{IN6ADDR_ANY_INIT, 0, 0, 0, 0}};
+ struct odhcpd_ipaddr *addr = NULL;
time_t now = odhcpd_time();
- ssize_t len = odhcpd_get_interface_addresses(iface->ifindex, addr, ARRAY_SIZE(addr));
+ ssize_t len = odhcpd_get_interface_addresses(iface->ifindex, &addr);
if (len < 0)
return;
@@ -380,7 +380,8 @@ static void check_addr_updates(struct interface *iface)
if (change)
dhcpv6_ia_preupdate(iface);
- memcpy(iface->ia_addr, addr, len * sizeof(*addr));
+ free(iface->ia_addr);
+ iface->ia_addr = addr;
iface->ia_addr_len = len;
if (change)