+ break;
+
+ case DHCPV6_STATEFUL:
+ script_call("bound");
+ bound = true;
+ syslog(LOG_NOTICE, "entering stateful-mode on %s", ifname);
+#ifdef EXT_BFD_PING
+ if (bfd_interval > 0)
+ bfd_start(ifname, bfd_loss, bfd_interval);
+#endif
+
+ while (!signal_usr2 && !signal_term) {
+ // Renew Cycle
+ // Wait for T1 to expire or until we get a reconfigure
+ int res = dhcpv6_poll_reconfigure();
+ odhcp6c_signal_process();
+ if (res > 0) {
+ script_call("updated");
+ continue;
+ }
+
+ // Handle signal, if necessary
+ if (signal_usr1)
+ signal_usr1 = false; // Acknowledged
+ if (signal_usr2 || signal_term)
+ break; // Other signal type
+
+ // Send renew as T1 expired
+ size_t ia_pd_len, ia_na_len;
+ odhcp6c_get_state(STATE_IA_PD, &ia_pd_len);
+ odhcp6c_get_state(STATE_IA_NA, &ia_na_len);
+
+ // If we have any IAs, send renew, otherwise request
+ if (ia_pd_len == 0 && ia_na_len == 0)
+ res = dhcpv6_request(DHCPV6_MSG_REQUEST);
+ else
+ res = dhcpv6_request(DHCPV6_MSG_RENEW);
+
+ odhcp6c_signal_process();
+ if (res > 0) { // Renew was succesfull
+ // Publish updates
+ script_call("updated");
+ continue; // Renew was successful
+ }