diff options
author | Matija Amidzic <matija.amidzic@sartura.hr> | 2018-12-21 15:58:47 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-01-15 11:33:43 +0100 |
commit | 7abbed4fba6c9b75ec5331291eb7dc787f99a977 (patch) | |
tree | 16f27e93fe6e49c7b99e60eed26d588465ec2f87 /src/dhcpv6-ia.c | |
parent | dd1aefd24fa2b23a3f54a327636e06a782248b66 (diff) |
dhcpv6: add setting to choose IA_NA, IA_PD or both
Adds the config options to set if DHCPv6 'stateful addresing' hands out
IA_NA (Internet Address - Network Address), IA_PD (Internet Address -
Prefix Delegation), both or none.
Signed-off-by: Matija Amidzic <matija.amidzic@sartura.hr>
Diffstat (limited to 'src/dhcpv6-ia.c')
-rw-r--r-- | src/dhcpv6-ia.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c index 3b2dfaf..415ec2a 100644 --- a/src/dhcpv6-ia.c +++ b/src/dhcpv6-ia.c @@ -1262,7 +1262,7 @@ ssize_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct interface *iface, (hdr->msg_type == DHCPV6_MSG_REBIND && !a)) { bool assigned = !!a; - if (!a && !iface->no_dynamic_dhcp) { + if (!a && !iface->no_dynamic_dhcp && (iface->dhcpv6_pd || iface->dhcpv6_na)) { /* Create new binding */ a = calloc(1, sizeof(*a) + clid_len); if (a) { @@ -1282,10 +1282,10 @@ ssize_t dhcpv6_handle_ia(uint8_t *buf, size_t buflen, struct interface *iface, odhcpd_urandom(a->key, sizeof(a->key)); memcpy(a->clid_data, clid_data, clid_len); - if (is_pd) + if (is_pd && iface->dhcpv6_pd) while (!(assigned = assign_pd(iface, a)) && !a->managed_size && ++a->length <= 64); - else + else if (is_na && iface->dhcpv6_na) assigned = assign_na(iface, a); if (a->managed_size && !assigned) |