diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2017-08-10 15:44:09 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2017-08-10 18:46:57 +0200 |
commit | ff5020d9c0474c6a76ee30e499983a4d3a9f27b7 (patch) | |
tree | b880b55d0be62a50722aa004578a47a456ef3b3c /src/dhcpv6.h | |
parent | 95d0fb6c25944985b9717a51cebaa7ea8dc7222d (diff) |
dhcpv6-ia: rework reconfigure accept logic
Rework reconfigure accept retransmission logic; every DHCPv6 assignment
has its own reconfigure accept timer now making sure the timeout and
retransmission behavior is in line with RFC3315 paragraph 19.1.2.
While at it rename the original reconf_timer into valid_until_timeout as
it will only check now the lifetime of the assignments.
Set reconf_cnt to INT_MAX for every assignment which belongs to the same
client identifier; before the reconf_cnt of the first handled assignment
was set by mistake breaking the retransmission logic.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/dhcpv6.h')
-rw-r--r-- | src/dhcpv6.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/dhcpv6.h b/src/dhcpv6.h index e58cb69..de815cf 100644 --- a/src/dhcpv6.h +++ b/src/dhcpv6.h @@ -76,6 +76,9 @@ #define DHCPV6_HOP_COUNT_LIMIT 32 +#define DHCPV6_REC_TIMEOUT 2000 /* msec */ +#define DHCPV6_REC_MAX_RC 8 + struct dhcpv6_client_header { uint8_t msg_type; uint8_t transaction_id[3]; @@ -139,17 +142,21 @@ struct dhcpv6_ia_addr { struct dhcpv6_assignment { struct list_head head; + struct interface *iface; + struct sockaddr_in6 peer; time_t valid_until; - time_t reconf_sent; + + struct uloop_timeout reconf_timer; + bool accept_reconf; int reconf_cnt; - char *hostname; uint8_t key[16]; + + char *hostname; uint32_t assigned; uint32_t iaid; uint8_t mac[6]; uint8_t length; // length == 128 -> IA_NA, length <= 64 -> IA_PD - bool accept_reconf; struct odhcpd_ipaddr *managed; ssize_t managed_size; |